diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 855156d..b59df6c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build +name: Build and Test on: push: @@ -63,7 +63,8 @@ jobs: dist/tljh_repo2docker*.whl if-no-files-found: error - test_isolated: + isolated-tests: + name: Isolated tests needs: build runs-on: ubuntu-latest @@ -91,6 +92,58 @@ jobs: shell: bash -l {0} run: python -c "import tljh_repo2docker" + unit-tests: + name: Unit tests + needs: build + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.8", "3.9", "3.10"] + jupyterhub-version: [latest, 1.2.2] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: mamba-org/setup-micromamba@v1 + with: + micromamba-version: "1.5.5-0" + environment-name: tljh + init-shell: bash + create-args: >- + python=${{ matrix.python-version }} + nodejs=18 + yarn=3 + + - name: Download app package + uses: actions/download-artifact@v3 + with: + name: tljh_repo2docker-artifacts + + - name: Install package + shell: bash -l {0} + run: | + set -eux + python -m pip install -r dev-requirements.txt + python -m pip install tljh_repo2docker*.whl + npm -g install configurable-http-proxy + + - name: Upgrade jupyterhub + if: ${{ matrix.jupyterhub-version == 'latest' }} + run: | + python -m pip install -U 'jupyterhub' + + - name: Downgrade jupyterhub + if: ${{ matrix.jupyterhub-version != 'latest' }} + run: | + python -m pip install -U 'jupyterhub==${{ matrix.jupyterhub-version }}' + + - name: Run Tests + run: | + python -m pytest --cov + integration-tests: name: Integration tests needs: build @@ -123,8 +176,6 @@ jobs: shell: bash -l {0} run: | set -eux - # Remove NodeJS, twice to take care of system and locally installed node versions. - python -m pip install -r dev-requirements.txt python -m pip install tljh_repo2docker*.whl npm -g install configurable-http-proxy diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index c65da60..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Tests - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: ["3.8", "3.9", "3.10"] - jupyterhub-version: [latest, 1.2.2] - - steps: - - uses: actions/checkout@v2 - - name: Install node - uses: actions/setup-node@v2 - with: - node-version: '18.x' - - name: Install configurable-http-proxy - run: npm -g install configurable-http-proxy - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools - python -m pip install -r dev-requirements.txt - python -m pip install -e . - - name: Downgrade jupyterhub - if: ${{ matrix.jupyterhub-version != 'latest' }} - run: | - python -m pip install -U 'jupyterhub==${{ matrix.jupyterhub-version }}' - - name: Run Tests - run: | - python -m pytest --cov diff --git a/frontend/ui-tests/playwright.config.js b/frontend/ui-tests/playwright.config.js index 037c497..7940ca3 100644 --- a/frontend/ui-tests/playwright.config.js +++ b/frontend/ui-tests/playwright.config.js @@ -10,13 +10,5 @@ module.exports = { toMatchSnapshot: { maxDiffPixelRatio: 0.02, }, - }, - webServer: [ - { - command: "yarn start", - port: 8000, - timeout: 120 * 1000, - reuseExistingServer: false, - }, - ], + } };