@@ -28,13 +28,10 @@ Let's try to deploy our site.
28
28
Along the way we'll catch an unexpected bug (that's what staging is for!),
29
29
and then we'll have to figure out a way of managing the database on the test server:
30
30
31
- * TODO: ansible instead of fab
32
-
33
31
[role="against-server small-code"]
34
32
[subs="specialcharacters,quotes"]
35
33
----
36
34
$ pass:quotes[*ansible-playbook --user=elspeth -i staging.ottg.co.uk, infra/ansible-provision.yaml -vv*]
37
-
38
35
39
36
PLAYBOOK: ansible-provision.yaml ***********************************************
40
37
1 plays in infra/ansible-provision.yaml
@@ -47,7 +44,7 @@ Here's what happens when we run the functional tests:
47
44
[role="small-code"]
48
45
[subs="specialcharacters,macros"]
49
46
----
50
- $ pass:quotes[*TEST_SERVER=staging.ottg.co.uk python manage.py test functional_tests*]
47
+ $ pass:quotes[*TEST_SERVER=staging.ottg.co.uk python src/ manage.py test functional_tests*]
51
48
52
49
======================================================================
53
50
ERROR: test_logged_in_users_lists_are_saved_as_my_lists
@@ -179,7 +176,7 @@ Now if we rerun our FTs, we see a change:
179
176
[role="small-code"]
180
177
[subs="specialcharacters,macros"]
181
178
----
182
- $ pass:quotes[*TEST_SERVER=staging.ottg.co.uk python manage.py test functional_tests*]
179
+ $ pass:quotes[*TEST_SERVER=staging.ottg.co.uk python src/ manage.py test functional_tests*]
183
180
184
181
[...]
185
182
Traceback (most recent call last):
@@ -390,7 +387,7 @@ that can actually check for logins that work, involving real emails!
390
387
[role="small-code"]
391
388
[subs="specialcharacters,macros"]
392
389
----
393
- $ pass:quotes[*TEST_SERVER=staging.ottg.co.uk python manage.py test functional_tests.test_login*]
390
+ $ pass:quotes[*TEST_SERVER=staging.ottg.co.uk python src/ manage.py test functional_tests.test_login*]
394
391
[...]
395
392
OK
396
393
----
@@ -420,7 +417,7 @@ so the "My Lists" test fails:
420
417
[role="skipme small-code"]
421
418
[subs="specialcharacters,macros"]
422
419
----
423
- $ pass:quotes[*TEST_SERVER=staging.ottg.co.uk python manage.py test functional_tests*]
420
+ $ pass:quotes[*TEST_SERVER=staging.ottg.co.uk python src/ manage.py test functional_tests*]
424
421
425
422
ERROR: test_logged_in_users_lists_are_saved_as_my_lists
426
423
(functional_tests.test_my_lists.MyListsTest)
@@ -511,7 +508,7 @@ and the management command prints it out at the command line. Try it out:
511
508
[role="skipme"]
512
509
[subs="specialcharacters,macros"]
513
510
----
514
- $ pass:quotes[*python manage.py create_session [email protected] *]
511
+ $ pass:quotes[*python src/ manage.py create_session [email protected] *]
515
512
Unknown command: 'create_session'
516
513
----
517
514
@@ -539,7 +536,7 @@ Now it works:
539
536
540
537
[subs="specialcharacters,macros"]
541
538
----
542
- $ pass:quotes[*python manage.py create_session [email protected] *]
539
+ $ pass:quotes[*python src/ manage.py create_session [email protected] *]
543
540
qnslckvp2aga7tm6xuivyb0ob1akzzwl
544
541
----
545
542
@@ -739,21 +736,19 @@ break anything:
739
736
740
737
[subs="specialcharacters,macros"]
741
738
----
742
- $ pass:quotes[*python manage.py test functional_tests.test_my_lists*]
739
+ $ pass:quotes[*python src/ manage.py test functional_tests.test_my_lists*]
743
740
[...]
744
741
OK
745
742
----
746
743
747
744
748
- Next, against the server. We push our code up first:
745
+ Next, against the server.
749
746
750
747
751
748
[role="against-server"]
752
749
[subs="specialcharacters,quotes"]
753
750
----
754
- $ *git push* # you'll need to commit changes first.
755
- $ *cd deploy_tools*
756
-
751
+ $ pass:quotes[*ansible-playbook --user=elspeth -i staging.ottg.co.uk, infra/ansible-provision.yaml -vv*]
757
752
----
758
753
759
754
And now we run the test:
@@ -762,7 +757,7 @@ And now we run the test:
762
757
[role="against-server small-code"]
763
758
[subs=""]
764
759
----
765
- $ <strong>TEST_SERVER=staging.ottg.co.uk python manage.py test \
760
+ $ <strong>TEST_SERVER=staging.ottg.co.uk python src/ manage.py test \
766
761
functional_tests.test_my_lists</strong>
767
762
[...]
768
763
@@ -785,7 +780,7 @@ Looking good! We can rerun all the tests to make sure...
785
780
[role="against-server small-code"]
786
781
[subs=""]
787
782
----
788
- $ <strong>TEST_SERVER=staging.ottg.co.uk python manage.py test functional_tests</strong>
783
+ $ <strong>TEST_SERVER=staging.ottg.co.uk python src/ manage.py test functional_tests</strong>
789
784
[...]
790
785
791
786
~/sites/staging.ottg.co.uk/.venv/bin/python
0 commit comments