diff --git a/.github/workflows/ci_debug.yml b/.github/workflows/ci_debug.yml deleted file mode 100644 index 3d28c629..00000000 --- a/.github/workflows/ci_debug.yml +++ /dev/null @@ -1,52 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Debug CI - -# Controls when the workflow will run -on: - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - run-tests: - # The type of runner that the job will run on - runs-on: ubuntu-latest - timeout-minutes: 10 - - strategy: - matrix: - python-version: [3.8.x] - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - name: Checkout master - uses: actions/checkout@v2 - with: - ref: 'test/debug_ci' - - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -r requirements.txt - python -m pip install -r requirements/ci.txt - python -m pip install -e . - - - name: Run test suite - run: | - python -m pytest --pyargs redengine - - # Seems there is a possible problem with pytest-cov parallelization - #- name: Run test suite - # run: | - # python -m pytest --pyargs redengine --cov-report=xml --cov-config=.coveragerc - - #- name: Upload test coverage - # uses: codecov/codecov-action@v2 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f769c348..86eced7d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,4 +43,4 @@ jobs: - name: Run test suite working-directory: ./requirements run: | - python -m pytest --pyargs rocketry -W error::UserWarning -W error::FutureWarning -W error::DeprecationWarning + python -m pytest --check-build --pyargs rocketry -W error::UserWarning -W error::FutureWarning -W error::DeprecationWarning diff --git a/.github/workflows/test_cov.yml b/.github/workflows/test_cov.yml index 4da5ffad..ac9e77d0 100644 --- a/.github/workflows/test_cov.yml +++ b/.github/workflows/test_cov.yml @@ -40,7 +40,7 @@ jobs: - name: Run test suite run: | - python -m pytest --cov=rocketry --cov-report=xml rocketry/test --no-build + python -m pytest --cov=rocketry --cov-report=xml rocketry/test - name: Upload test coverage uses: codecov/codecov-action@v2 diff --git a/.github/workflows/test_pr.yml b/.github/workflows/test_pr.yml deleted file mode 100644 index 5d9de7dc..00000000 --- a/.github/workflows/test_pr.yml +++ /dev/null @@ -1,48 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: PR-test - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the master branch - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - run-tests: - # The type of runner that the job will run on - runs-on: ubuntu-latest - timeout-minutes: 10 - - strategy: - matrix: - python-version: [3.6.x, 3.8.x, 3.10.x] - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -r requirements.txt - python -m pip install -r requirements/ci.txt - python -m pip install -e . - - - name: Run test suite - run: | - python -m pytest --pyargs rocketry - - # Seems there is a possible problem with pytest-cov parallelization - #- name: Run test suite - # run: | - # python -m pytest --pyargs redengine --cov-report=xml --cov-config=.coveragerc - - #- name: Upload test coverage - # uses: codecov/codecov-action@v2 diff --git a/rocketry/test/conftest.py b/rocketry/test/conftest.py index d04fd27a..38c8f4fd 100644 --- a/rocketry/test/conftest.py +++ b/rocketry/test/conftest.py @@ -21,11 +21,11 @@ def pytest_addoption(parser): parser.addoption( - '--no-build', - action='store_false', - dest="is_build", - default=True, - help='Expect the package is not built.' + '--check-build', + action='store_true', + dest="check_build", + default=False, + help='Check the package is built correctly.' ) # Utils diff --git a/rocketry/test/test_build.py b/rocketry/test/test_build.py index 47672bc5..49777879 100644 --- a/rocketry/test/test_build.py +++ b/rocketry/test/test_build.py @@ -2,8 +2,7 @@ import rocketry def test_build(request): - expect_build = request.config.getoption('is_build') - if not expect_build: - assert rocketry.version == '0.0.0.UNKNOWN' - else: - assert rocketry.version != '0.0.0.UNKNOWN' \ No newline at end of file + verify_build = request.config.getoption('check_build') + if not verify_build: + pytest.skip(reason="Pass '--check-build' to verify the package is built") + assert rocketry.version != '0.0.0.UNKNOWN' \ No newline at end of file