From 829d90b25727cfb7673fcae04d081d5d20cf5e7a Mon Sep 17 00:00:00 2001 From: chaton Date: Tue, 20 Oct 2020 15:38:17 +0100 Subject: [PATCH] activated color in all pytest runs (#4254) * activated color in all pytest runs * Update .drone.yml Co-authored-by: Jeff Yang Co-authored-by: Jeff Yang --- .drone.yml | 4 ++-- .github/CONTRIBUTING.md | 2 +- .github/workflows/ci_test-base.yml | 2 +- .github/workflows/ci_test-conda.yml | 2 +- .github/workflows/ci_test-full.yml | 2 +- dockers/tpu-tests/tpu_test_cases.jsonnet | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.drone.yml b/.drone.yml index b69011027ad09..5c759f042e661 100644 --- a/.drone.yml +++ b/.drone.yml @@ -56,8 +56,8 @@ steps: - pip install -r ./requirements/examples.txt --user -q --upgrade-strategy only-if-needed - pip list - python -c "import torch ; print(' & '.join([torch.cuda.get_device_name(i) for i in range(torch.cuda.device_count())]) if torch.cuda.is_available() else 'only CPU')" - - coverage run --source pytorch_lightning -m py.test pytorch_lightning tests -v --durations=25 # --flake8 - - python -m py.test benchmarks pl_examples -v --maxfail=2 --durations=0 # --flake8 + - coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v --color=yes --durations=25 # --flake8 + - python -m py.test benchmarks pl_examples -v --color=yes --maxfail=2 --durations=0 # --flake8 #- cd docs; make doctest; make coverage - coverage report # see: https://docs.codecov.io/docs/merging-reports diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index ca521d9b576a6..bed729e02baeb 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -196,7 +196,7 @@ This is useful if you do not test against all required dependency versions. **Docker:** Another option is utilize the [pytorch lightning cuda base docker image](https://hub.docker.com/repository/docker/pytorchlightning/pytorch_lightning/tags?page=1&name=cuda). You can then run: ```bash -python -m pytest pytorch_lightning tests pl_examples -v --flake8 +python -m pytest pytorch_lightning tests pl_examples -v --color=yes --flake8 ``` ### Pull Request diff --git a/.github/workflows/ci_test-base.yml b/.github/workflows/ci_test-base.yml index 041bbb6268e28..9b490dec76ee6 100644 --- a/.github/workflows/ci_test-base.yml +++ b/.github/workflows/ci_test-base.yml @@ -69,7 +69,7 @@ jobs: - name: Test Package [only] run: | # NOTE: run coverage on tests does not propagare faler status for Win, https://github.com/nedbat/coveragepy/issues/1003 - coverage run --source pytorch_lightning -m pytest pytorch_lightning -v --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml + coverage run --source pytorch_lightning -m pytest pytorch_lightning -v --color=yes --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml - name: Upload pytest test results uses: actions/upload-artifact@master diff --git a/.github/workflows/ci_test-conda.yml b/.github/workflows/ci_test-conda.yml index a71826905888b..3289f5cbecf5e 100644 --- a/.github/workflows/ci_test-conda.yml +++ b/.github/workflows/ci_test-conda.yml @@ -41,7 +41,7 @@ jobs: - name: Tests run: | # NOTE: run coverage on tests does not propagare faler status for Win, https://github.com/nedbat/coveragepy/issues/1003 - python -m pytest pytorch_lightning tests -v --durations=0 --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml + python -m pytest pytorch_lightning tests -v --color=yes --durations=0 --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml # coverage report shell: bash -l {0} diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index e7c7ad486ba55..d74a923693e0b 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -119,7 +119,7 @@ jobs: - name: Tests run: | # NOTE: do not include coverage report here, see: https://github.com/nedbat/coveragepy/issues/1003 - coverage run --source pytorch_lightning -m pytest pytorch_lightning tests pl_examples -v --durations=0 --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml + coverage run --source pytorch_lightning -m pytest pytorch_lightning tests pl_examples -v --color=yes --durations=0 --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml - name: Upload pytest test results uses: actions/upload-artifact@master diff --git a/dockers/tpu-tests/tpu_test_cases.jsonnet b/dockers/tpu-tests/tpu_test_cases.jsonnet index 9294727f420b6..99bcb024d9ee3 100644 --- a/dockers/tpu-tests/tpu_test_cases.jsonnet +++ b/dockers/tpu-tests/tpu_test_cases.jsonnet @@ -21,7 +21,7 @@ local tputests = base.BaseTest { command: utils.scriptCommand( ||| cd pytorch-lightning - coverage run --source=pytorch_lightning -m pytest tests/models/test_tpu.py -v + coverage run --source=pytorch_lightning -m pytest tests/models/test_tpu.py -v --color=yes test_exit_code=$? echo "\n||| END PYTEST LOGS |||\n" coverage xml