Skip to content

Commit 842b8b9

Browse files
committed
set logging directory as an artifact
1 parent 1e37816 commit 842b8b9

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

circle.yml

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ test:
3434
general:
3535
artifacts:
3636
- "~/docs"
37+
- "~/logs"
3738
- "~/coverage.xml"
3839
- "~/nosetests.xml"
3940
- "~/builddocs.log"

docker/circleci/teardown.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ set -u
77
set -e
88

99
mkdir -p ${CIRCLE_TEST_REPORTS}/nose
10+
sudo mv ~/scratch/builddocs.log ~/builddocs.log
1011
sudo cp ~/scratch/nosetests.xml ${CIRCLE_TEST_REPORTS}/nose/${CIRCLE_PROJECT_REPONAME}.xml
1112
sudo mv ~/scratch/coverage.xml ~/coverage.xml
1213
mkdir -p ~/docs
1314
sudo mv ~/scratch/docs/* ~/docs/
14-
sudo mv ~/scratch/builddocs.log ~/builddocs.log
15+
mkdir -p ~/logs
16+
sudo mv ~/scratch/logs/* ~/logs/

tools/run_examples.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,16 @@ def run_examples(example, pipelines, data_path, plugin=None):
2727
wf.base_dir = os.path.join(os.getcwd(), 'output', example, plugin)
2828
if os.path.exists(wf.base_dir):
2929
rmtree(wf.base_dir)
30+
31+
# Handle a logging directory
32+
log_dir = os.path.join(os.getcwd(), 'logs', example)
33+
if os.path.exists(log_dir):
34+
rmtree(log_dir)
35+
os.makedirs(log_dir)
3036
wf.config = {'execution': {'hash_method': 'timestamp',
3137
'stop_on_first_rerun': 'true',
32-
'write_provenance': 'true'}}
38+
'write_provenance': 'true'},
39+
'logging': {'log_directory': log_dir, 'log_to_file': True}}
3340
wf.inputs.inputnode.in_data = os.path.abspath(data_path)
3441
wf.run(plugin=plugin, plugin_args=plugin_args)
3542
# run twice to check if nothing is rerunning

0 commit comments

Comments
 (0)