-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (61 loc) · 2.97 KB
/
crim-test.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: crim_test
on: [push] # activates the workflow on Push
jobs:
test_crim_app:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
- name: Install dependencies
run: |
pip install flake8
pip install -r test_requirements.txt # install dependencies from the Deveopment Requirements
playwright install # install playwright browsers
cp "crim/test_settings_production.py" "crim/settings_production.py" # copy the Production Settings file
- name: Make Migrations
run: |
python manage.py makemigrations # making migrations
python manage.py migrate # migrating
- name: Import Definitions
run: python manage.py loaddata crim/fixtures/definitions.json # importing definitions
- name: Testing Models
run: python manage.py test crim.tests.test_models
- name: Testing Views
run: python manage.py test crim.tests.test_views
- name: Testing API
run: python manage.py test crim.tests.test_API_views
- name: Clearing Data for Functional Testing
run: |
python manage.py flush --no-input
python manage.py makemigrations
python manage.py migrate
- name: Loading Data for Functional Testing
run: |
python manage.py loaddata crim/fixtures/data-2023-05/definition.json
python manage.py loaddata crim/fixtures/data-2023-05/genre.json
python manage.py loaddata crim/fixtures/data-2023-05/person.json
python manage.py loaddata crim/fixtures/data-2023-05/mass.json
python manage.py loaddata crim/fixtures/data-2023-05/piece.json
python manage.py loaddata crim/fixtures/data-2023-05/part.json
python manage.py loaddata crim/fixtures/data-2023-05/phrase.json
python manage.py loaddata crim/fixtures/data-2023-05/voice.json
python manage.py loaddata crim/fixtures/data-2023-05/treatise.json
python manage.py loaddata crim/fixtures/data-2023-05/source.json
python manage.py loaddata crim/fixtures/data-2023-05/roletype.json
python manage.py loaddata crim/fixtures/data-2023-05/role.json
python manage.py loaddata crim/fixtures/data-2023-05/observation.json
python manage.py loaddata crim/fixtures/data-2023-05/relationship.json
python manage.py loaddata crim/fixtures/data-2023-05/flatpages.json
- name: Running Server and FT
run: |
python manage.py runserver &
python manage.py test crim.tests.test_functional
- name: Flake8 Testing
run: flake8 . --exit-zero --max-line-length=127 # run flake8 test
- name: Remove the Settings file copy and the Fixtures file
run: |
rm "crim/settings_production.py" # removing the copy of Production Settings
- name: Done Testing
run: echo "Done Testing" # echoing