Skip to content

Commit

Permalink
Now skipping WhatsOpt test by default
Browse files Browse the repository at this point in the history
Setting env variable RUN_WEB_REQUESTS to 1 or True will make pytest run the test.
  • Loading branch information
christophe-david committed Jul 13, 2023
1 parent 87f357b commit 8d27773
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/watchman_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ jobs:
path: requirements.txt

- name: Unit tests
if: ${{ runner.os == 'Linux' }} # WhatsOpt tests will be run only on Linux to avoid unneeded traffic
env:
RUN_WEB_REQUESTS: True
run: pytest --no-cov src
shell: bash

- name: Unit tests
if: ${{ runner.os != 'Linux' }}
run: pytest --no-cov src
shell: bash

Expand Down
8 changes: 6 additions & 2 deletions src/fastoad/openmdao/tests/test_whatsopt.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of FAST-OAD : A framework for rapid Overall Aircraft Design
# Copyright (C) 2021 ONERA & ISAE-SUPAERO
# Copyright (C) 2023 ONERA & ISAE-SUPAERO
# FAST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
Expand All @@ -10,7 +10,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

import os
import os.path as pth
from shutil import rmtree

Expand All @@ -29,6 +29,10 @@ def cleanup():
rmtree(RESULTS_FOLDER_PATH, ignore_errors=True)


@pytest.mark.skipif(
str(os.environ.get("RUN_WEB_REQUESTS")).lower() in ["true", "1", "t", "y", "yes"],
reason="Using web access during tests should not be the default behavior.",
)
def test_write_xdsm(cleanup):

problem = FASTOADProblem()
Expand Down

0 comments on commit 8d27773

Please sign in to comment.