From 94ccb3bc3fcdc3f0149f14dfe881412f5a76ddb3 Mon Sep 17 00:00:00 2001 From: Naoto Mizuno Date: Tue, 31 Oct 2023 10:36:24 +0900 Subject: [PATCH] Put together in options --- .github/workflows/tests.yml | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c81534aac7..436924b689 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -74,30 +74,23 @@ jobs: pip install pipdeptree pipdeptree - - name: Scheduled tests - if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + - name: Tests run: | - if [ ${{ matrix.python-version }} == 3.12 ]; then - # TODO(not522): Remove ignores when BoTorch supports Python 3.12 - pytest tests -m "not integration" \ - --ignore tests/terminator_tests/ \ - --ignore tests/visualization_tests/test_terminator_improvement.py + if [ "${{ github.event_name }}" = "schedule" ] || \ + [ "${{ github.event_name }}" = "workflow_dispatch" ] ; then + target="not integration" else - pytest tests -m "not integration" + target="not integration and not slow" fi - env: - SQLALCHEMY_WARN_20: 1 - - name: Tests - if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }} - run: | - if [ ${{ matrix.python-version }} == 3.12 ]; then + if [ "${{ matrix.python-version }}" = "3.12" ] ; then # TODO(not522): Remove ignores when BoTorch supports Python 3.12 - pytest tests -m "not integration and not slow" \ - --ignore tests/terminator_tests/ \ - --ignore tests/visualization_tests/test_terminator_improvement.py + ignore_option="--ignore tests/terminator_tests/ \ + --ignore tests/visualization_tests/test_terminator_improvement.py" else - pytest tests -m "not integration and not slow" + ignore_option="" fi + + pytest tests -m "$target" $ignore_option env: SQLALCHEMY_WARN_20: 1