@@ -32,6 +32,16 @@ installed as normal:
32
32
released when more invasive tests have been written. In the meantime we
33
33
use this repository as a Git [submodule] in our existing pipelines.
34
34
35
+ ### Redirecting output
36
+ Normally pipeline output files are written to a ` tmp ` directory inside
37
+ the working copy of the repository you're running in. Alternatively you
38
+ can write test output to your own directory (i.e. ` /tmp/blob ` ) using
39
+ the environment variable ` POUT ` : -
40
+
41
+ $ export POUT=/tmp/blob/
42
+
43
+ Output files are removed when the test suite starts and when it passes.
44
+
35
45
### From within a pipeline repository
36
46
You will find this repository located as a submodule. When checking the
37
47
pipeline out (for example [ Pipelines] ) you will need to initialise the
@@ -51,25 +61,57 @@ When tests fail it logs as much as it can and continues. When all the tests
51
61
have finished it prints a summary including a lit of failed tests along with
52
62
of the number of test files and individual tests that were executed: -
53
63
54
- -------
55
- Summary
56
- -------
57
- Test Files : 20
58
- Tests : 30
59
- Tests ignored: 0
60
- Tests failed : 0
61
- -------
62
- Passed: TRUE
63
-
64
+ +----------------+
65
+ : Summary:
66
+ +----------------+
67
+ : Test files: 29
68
+ : Tests found: 39
69
+ : Tests passed: 20
70
+ : Tests failed: -
71
+ : Tests skipped: 19
72
+ : Tests ignored: 3
73
+ : Warnings: -
74
+ +----------------+
75
+ : Result: SUCCESS
76
+ +----------------+
77
+
78
+ Fields in the summary should be self-explanatory but a couple might benefit
79
+ from further explanation: -
80
+
81
+ - ` Tests skipped ` are the tests that were found but not executed.
82
+ Normally these are the tests found during a _ Container_ test
83
+ that can't be run (because the test has no corresponding container image).
84
+ - ` Tests ignored ` are test found that are not run because they have
85
+ been marked for non-execution as the test name begins with ` ignore_ ` .
86
+
64
87
### From here
65
88
If you have working copies of all your pipeline repositories checked-out
66
89
in the same directory as this repository you can execute all the tests
67
90
across all the repositories by running the tester from here. Simply
68
91
run the following Gradle command from here: -
69
92
70
93
$ ./gradlew runPipelineTester
94
+
95
+ ### In Docker
96
+ You can run the pipeline tests in Docker using their expected container
97
+ image (defined in the service descriptor). Doing this gives you added
98
+ confidence that your pipeline will work wen deployed.
99
+
100
+ You can use the docker-specific Gradle task: -
101
+
102
+ $ ./gradlew runDockerPipelineTester
71
103
72
- ### Debugging test failures
104
+ Or, by adding the ` -d ` or ` --indocker ` command-line argument into the basic
105
+ task. To pass command-line options through Gradle into the underlying task
106
+ you can also run the Docker tests like this: -
107
+
108
+ $ ./gradlew runPipelineTester -Pptargs=-d
109
+
110
+ > When you run _ in docker_ only the tests that can run in Docker (those with
111
+ a defined image name) will be executed. Tests that cannot be executed in
112
+ Docker will be _skipped_.
113
+
114
+ ## Debugging test failures
73
115
Ideally your tests will pass. When they don't the test framework prints
74
116
the collected log to the screen as it happens but also keeps all the files
75
117
generated (by all the tests) in case they are of use for diagnostics.
@@ -80,6 +122,11 @@ for every file and test combination. For example, if the test file
80
122
` pbf_ev.test ` contains the test ` test_pbf_ev_raw ` any files it generates
81
123
will be found in the directory ` pbf_ev-test_pbf_ev_raw ` .
82
124
125
+ You can re-direct the test output to an existing directory of your choice by
126
+ defining the Environment variable ` POUT ` : -
127
+
128
+ $ export POUT=/tmp/my-output-dir/
129
+
83
130
Some important notes: -
84
131
85
132
- Files generated by the pipelines are removed when the tester is
@@ -102,6 +149,13 @@ in order to create a set of tests for a new pipeline.
102
149
> At the moment the tester only permits one test file per pipeline so all
103
150
tests for a given pipeline need to be composed in one file.
104
151
152
+ ## Testing the pipeline utilities
153
+ The pipeline utilities consist of a number of Python-based modules
154
+ that can be tested using ` setup.py ` . To test these modules run the
155
+ following from the ` src/python ` directory: -
156
+
157
+ $ python setup.py test
158
+
105
159
---
106
160
107
161
[ Conda ] : https://conda.io/docs/
0 commit comments