Skip to content

Commit

Permalink
Move unit tests to build and test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
trungleduc committed Jan 22, 2024
1 parent bce691a commit 0959f89
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 54 deletions.
59 changes: 55 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Build and Test

on:
push:
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
41 changes: 0 additions & 41 deletions .github/workflows/test.yml

This file was deleted.

10 changes: 1 addition & 9 deletions frontend/ui-tests/playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,5 @@ module.exports = {
toMatchSnapshot: {
maxDiffPixelRatio: 0.02,
},
},
webServer: [
{
command: "yarn start",
port: 8000,
timeout: 120 * 1000,
reuseExistingServer: false,
},
],
}
};

0 comments on commit 0959f89

Please sign in to comment.