Newer
Older
# NOTE, MAKE SURE ANY PIPELINE-LEVEL VARIABLES ARE UNIQUE TO THIS PIPELINE
# WHEN CALLED FROM A MULTI-PIPELINE TRIGGER, VARIABLES WITH SHARED NAMES WILL BE OVERWRITTEN
# OUTPUT_DIR: "/storage/app/EWS_prod/regions/EastAfrica/workspace/"
TEST_WORKSPACE_DIR: "/storage/app/EWS_prod/regions/EastAfrica/test_workspace/"
- "today"
- "yesterday"
- "custom"
description: "Full-fat tests will pull data from the deployment environment. For robustness, the default option is a
pre-selected date we know works. Select \"today\" or \"yesterday\" to test with recent live data. If \"custom\" is
selected, manually enter the key value pair using the format in this example: CUSTOM_RUN_DATE 20230115"
FULL_FAT_COPY_OUTPUT:
value: "false"
options:
- "true"
- "false"
description: "Select \"true\" to make a copy of the full-fat integration test output. Outputs will be copied to the
production machine at /storage/app/EWS_prod/regions/EastAfrica/test_workspace"
- PACKAGES_DIR="$CI_PROJECT_DIR/packages/"
- echo "project dir - " $CI_PROJECT_DIR
- echo "output dir - " $OUTPUT_DIR
- echo "packages dir - " $PACKAGES_DIR
- echo "full-fat run date - " $FULL_FAT_RUN_DATE
- echo "custom full-fat run date - " $CUSTOM_RUN_DATE
- echo "full-fat copy output - " $FULL_FAT_COPY_OUTPUT
- source /storage/app/miniconda3/bin/activate /storage/app/EWS_prod/envs/conda/py3EWS/
- pip install coverage
- python3 -V # Print out python version for debugging
- mkdir -p $PACKAGES_DIR
- git clone "https://nouser:$GROUP_WHEAT_ACCESS_VAR@gitlab.developers.cam.ac.uk/gilligan-epid/wheat-rusts/ews-source-generation.git" $PACKAGES_DIR/source_gen
- git clone "https://nouser:$GROUP_WHEAT_ACCESS_VAR@gitlab.developers.cam.ac.uk/gilligan-epid/wheat-rusts/ews_plotting.git" $PACKAGES_DIR/plotting
- git clone "https://nouser:$GROUP_WHEAT_ACCESS_VAR@gitlab.developers.cam.ac.uk/gilligan-epid/wheat-rusts/flagdir.git" $PACKAGES_DIR/flagdir
- git clone "https://nouser:$GROUP_WHEAT_ACCESS_VAR@gitlab.developers.cam.ac.uk/gilligan-epid/wheat-rusts/ews-epimodel.git" $PACKAGES_DIR/epimodel
- git clone "https://nouser:$GROUP_WHEAT_ACCESS_VAR@gitlab.developers.cam.ac.uk/gilligan-epid/wheat-rusts/ews-advisory-builder.git" $PACKAGES_DIR/advisory_builder
- git clone "https://nouser:$GROUP_WHEAT_ACCESS_VAR@gitlab.developers.cam.ac.uk/gilligan-epid/wheat-rusts/ews_environmental_suitability_v2.git" $PACKAGES_DIR/environmental_suitability
- git clone "https://nouser:$GROUP_WHEAT_ACCESS_VAR@gitlab.developers.cam.ac.uk/gilligan-epid/wheat-rusts/ews-postprocessing.git" $PACKAGES_DIR/post_processing
- git clone "https://nouser:$GROUP_WHEAT_ACCESS_VAR@gitlab.developers.cam.ac.uk/gilligan-epid/wheat-rusts/ews-met-processing.git" $PACKAGES_DIR/met_processing
- flagdir=$PACKAGES_DIR/flagdir
- epimodel=$PACKAGES_DIR/epimodel
- advisory=$PACKAGES_DIR/advisory_builder
- met_processing=$PACKAGES_DIR/met_processing
- met_processor=$PACKAGES_DIR/environmental_suitability
- plotting=$PACKAGES_DIR/plotting
- post_processing=$PACKAGES_DIR/post_processing
- source_gen=$PACKAGES_DIR/source_gen
- coordinator=$CI_PROJECT_DIR/coordinator
- coordinator_tests=$CI_PROJECT_DIR/tests
- export PYTHONPATH=$PYTHONPATH:$met_processor_temp:$flagdir:$epimodel:$advisory:$met_processing:$met_processor:$plotting:$source_gen:$post_processing:$coordinator:$coordinator_tests
- ls $PACKAGES_DIR
- python3 -m coverage run run_test_suite.py $CI_PROJECT_DIR/test_reports
# - python3 -m coverage run -m unittest test_advisory.py
# - python3 -m coverage run -m unittest test_deposition.py
# - python3 -m coverage run -m unittest test_env_suit.py
# - python3 -m coverage run -m unittest test_survey.py
- python3 -m coverage report
- python3 -m coverage html -d $CI_PROJECT_DIR/coverage
script:
- cd $CI_PROJECT_DIR/tests/integration/partial/
- python3 -m coverage run -m unittest test_epi.py
- python3 -m coverage report
- python3 -m coverage html -d $CI_PROJECT_DIR/coverage
- ls
artifacts:
paths:
- $CI_PROJECT_DIR/coverage
image: lb584/ews_coordinator:latest
cd $CI_PROJECT_DIR/tests/integration/full/
python3 full_test_deposition.py
--config /storage/app/EWS_prod/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json
--outdir $OUTPUT_DIR
--email_cred /storage/app/EWS_prod/envs/credentials/Cred_gmail.json
--test_report_dir $CI_PROJECT_DIR/test_reports
--run_date_type $FULL_FAT_RUN_DATE
--custom_run_date $CUSTOM_RUN_DATE
after_script:
- >
if [[ "$FULL_FAT_COPY_OUTPUT" == "true" ]];
then
date=$(date '+%Y-%m-%d-%H%M');
mkdir ${TEST_WORKSPACE_DIR}/integration/full/${date};
cp -r $OUTPUT_DIR/* ${TEST_WORKSPACE_DIR}/integration/full/${date};
- $CI_PROJECT_DIR/coverage
- $CI_PROJECT_DIR/test_reports
image: lb584/ews_coordinator:latest
tags: ["ewas-production"]
script:
- >
cd $CI_PROJECT_DIR/tests/integration/full/
python3 full_test_env_suit.py
--config /storage/app/EWS_prod/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json
--outdir $OUTPUT_DIR
--email_cred /storage/app/EWS_prod/envs/credentials/Cred_gmail.json
--run_date_type $FULL_FAT_RUN_DATE
--custom_run_date $CUSTOM_RUN_DATE
after_script:
- >
if [[ "$FULL_FAT_COPY_OUTPUT" == "true" ]];
then
date=$(date '+%Y-%m-%d-%H%M');
mkdir ${TEST_WORKSPACE_DIR}/integration/full/${date};
cp -r $OUTPUT_DIR/* ${TEST_WORKSPACE_DIR}/integration/full/${date};
fi
full_fat_survey:
when: manual
stage: full-fat
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
image: lb584/ews_coordinator:latest
tags: ["ewas-production"]
script:
- >
cd $CI_PROJECT_DIR/tests/integration/full/
python3 full_test_survey.py
--config /storage/app/EWS_prod/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json
--outdir $OUTPUT_DIR
--email_cred /storage/app/EWS_prod/envs/credentials/Cred_gmail.json
--run_date_type $FULL_FAT_RUN_DATE
--custom_run_date $CUSTOM_RUN_DATE
after_script:
- >
if [[ "$FULL_FAT_COPY_OUTPUT" == "true" ]];
then
date=$(date '+%Y-%m-%d-%H%M');
mkdir ${TEST_WORKSPACE_DIR}/integration/full/${date};
cp -r $OUTPUT_DIR/* ${TEST_WORKSPACE_DIR}/integration/full/${date};
fi
artifacts:
when: on_failure
paths:
- $OUTPUT_DIR/*/log.txt
- $OUTPUT_DIR/*.txt
expire_in: 10 days
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
full_fat_advisory:
when: manual
stage: full-fat
extends: .before_script
image: lb584/ews_coordinator:latest
tags: ["ewas-production"]
script:
- >
cd $CI_PROJECT_DIR/tests/integration/full/
python3 full_test_advisory.py
--config /storage/app/EWS_prod/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json
--outdir $OUTPUT_DIR
--email_cred /storage/app/EWS_prod/envs/credentials/Cred_gmail.json
--run_date_type $FULL_FAT_RUN_DATE
--custom_run_date $CUSTOM_RUN_DATE
after_script:
- >
if [[ "$FULL_FAT_COPY_OUTPUT" == "true" ]];
then
date=$(date '+%Y-%m-%d-%H%M');
mkdir ${TEST_WORKSPACE_DIR}/integration/full/${date};
cp -r $OUTPUT_DIR/* ${TEST_WORKSPACE_DIR}/integration/full/${date};
fi
artifacts:
when: on_failure
paths:
- $OUTPUT_DIR/*/log.txt
- $OUTPUT_DIR/*.txt
expire_in: 10 days
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
full_fat_epi:
when: manual
stage: full-fat
extends: .before_script
image: lb584/ews_coordinator:latest
tags: ["ewas-production"]
script:
- >
cd $CI_PROJECT_DIR/tests/integration/full/
python3 full_test_epi.py
--config /storage/app/EWS_prod/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json
--outdir $OUTPUT_DIR
--email_cred /storage/app/EWS_prod/envs/credentials/Cred_gmail.json
--run_date_type $FULL_FAT_RUN_DATE
--custom_run_date $CUSTOM_RUN_DATE
after_script:
- >
if [[ "$FULL_FAT_COPY_OUTPUT" == "true" ]];
then
date=$(date '+%Y-%m-%d-%H%M');
mkdir ${TEST_WORKSPACE_DIR}/integration/full/${date};
cp -r $OUTPUT_DIR/* ${TEST_WORKSPACE_DIR}/integration/full/${date};
fi
artifacts:
when: on_failure
paths:
- $OUTPUT_DIR/*/log.txt
- $OUTPUT_DIR/*.txt
expire_in: 10 days
extends: .before_script
image: lb584/ews_coordinator:latest
- export PATH=$PATH:/home/ewsmanager/.local/bin
- make html
- mkdir $CI_PROJECT_DIR/public
- mv -v $CI_PROJECT_DIR/docs/_build/html/* $CI_PROJECT_DIR/public/
- ls $CI_PROJECT_DIR/public/