forked from django/django
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusage_scenario.yml
47 lines (42 loc) · 1.39 KB
/
usage_scenario.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
name: Django test container
author: Arne Tarara <arne@green-coding.berlin>
version: 1
description: Energy measurements of the Django official unit tests
compose-file: !include compose.yml
sci:
R_d: Unit test
services:
gcb-django-tests:
setup-commands:
- apt update && apt install -y libmemcached-dev zlib1g-dev gcc
- pip install --upgrade pip
- mkdir /var/www
- cp -R /tmp/repo /var/www/django
# We have to copy the code outisde of the read-only mount in /tmp/repo, because django needs to write files.
shell: sh
deploy:
resources:
limits:
memory: 1G
cpus: 2
flow:
- name: Install Django base libraries
container: gcb-django-tests
commands:
- type: console
command: python -m pip install -e /var/www/django --root-user-action=ignore
- name: Install Django test libraries
container: gcb-django-tests
commands:
- type: console
command: python -m pip install -r /var/www/django/tests/requirements/py3.txt --root-user-action=ignore
- name: Run Django tests
container: gcb-django-tests
commands:
- type: console
command: python /var/www/django/tests/runtests.py --noinput | awk '/Found [0-9]+ test\(s\)/ { gsub(/Found | test\(s\)/, "", $0); print "GMT_SCI_R=" $0 }'
shell: bash
log-stdout: True
read-sci-stdout: True
ignore-errors: True