From fdc5a05b67e7eb24c4dd6783dca7b0d182bf6069 Mon Sep 17 00:00:00 2001 From: pdmurray Date: Tue, 23 Jul 2024 17:42:53 -0700 Subject: [PATCH] Reenable all unit tests; remove conda lockfile existence check --- .../test_conda_store_server_unit.yaml | 54 +++++++++---------- .../_internal/action/generate_lockfile.py | 5 -- 2 files changed, 27 insertions(+), 32 deletions(-) diff --git a/.github/workflows/test_conda_store_server_unit.yaml b/.github/workflows/test_conda_store_server_unit.yaml index fe3c0190b..1915a47b4 100644 --- a/.github/workflows/test_conda_store_server_unit.yaml +++ b/.github/workflows/test_conda_store_server_unit.yaml @@ -22,28 +22,28 @@ concurrency: cancel-in-progress: true jobs: - # linting: - # runs-on: ubuntu-latest - # defaults: - # run: - # working-directory: conda-store-server - # steps: - # - name: "Checkout Repository ๐Ÿ›Ž" - # uses: actions/checkout@v4 - # - # - name: "Set up Python ๐Ÿ" - # uses: actions/setup-python@v5 - # with: - # python-version-file: .python-version-default - # cache: "pip" - # - # - name: "Install Dependencies ๐Ÿ“ฆ" - # run: | - # python -m pip install hatch - # - # - name: "Linting Checks ๐Ÿงน" - # run: | - # hatch env run -e lint lint + linting: + runs-on: ubuntu-latest + defaults: + run: + working-directory: conda-store-server + steps: + - name: "Checkout Repository ๐Ÿ›Ž" + uses: actions/checkout@v4 + + - name: "Set up Python ๐Ÿ" + uses: actions/setup-python@v5 + with: + python-version-file: .python-version-default + cache: "pip" + + - name: "Install Dependencies ๐Ÿ“ฆ" + run: | + python -m pip install hatch + + - name: "Linting Checks ๐Ÿงน" + run: | + hatch env run -e lint lint test-conda-store-server: name: "unit-test - ${{ matrix.os}} " @@ -93,13 +93,10 @@ jobs: - name: "Unit tests โœ…" run: | - python -m pytest -svv ./tests/test_actions.py::test_install_lockfile - # python -m pytest -svv ./tests/test_app_api.py + python -m pytest -svv ./tests/test_actions.py + python -m pytest -svv ./tests/test_app_api.py # python -m pytest -m "not extended_prefix and not user_journey" tests - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - # https://github.com/actions/runner-images/issues/1052 - name: "Windows extended prefix unit tests โœ…" shell: pwsh @@ -111,3 +108,6 @@ jobs: (Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled pytest -m "extended_prefix" tests if: matrix.os == 'windows-latest' + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 diff --git a/conda-store-server/conda_store_server/_internal/action/generate_lockfile.py b/conda-store-server/conda_store_server/_internal/action/generate_lockfile.py index 96c6dabb6..755d12c52 100644 --- a/conda-store-server/conda_store_server/_internal/action/generate_lockfile.py +++ b/conda-store-server/conda_store_server/_internal/action/generate_lockfile.py @@ -51,11 +51,6 @@ def action_solve_lockfile( else: cuda_version = None - # Check that the lockfile exists - if not lockfile_filename.exists(): - context.log.critical(f"Lockfile {lockfile_filename} does not exist.") - raise ValueError(f"Lockfile {lockfile_filename} does not exist.") - # CONDA_FLAGS is used by conda-lock in conda_solver.solve_specs_for_arch with utils.set_environment(**{"CONDA_FLAGS": conda_flags}): run_lock(