Skip to content

Commit

Permalink
Use pnpm to run functional and startup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Oct 3, 2024
1 parent eaefd60 commit 8c0185a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ env:
enterprise-frontend-directory: ./enterprise/frontend
enterprise-frontend-build-directory: ./enterprise/frontend/.build/frontend
enterprise-backend-settings-module: enterprise_core.settings
DEBUG: pw:webserver

jobs:
functional-tests:
Expand Down Expand Up @@ -60,7 +61,7 @@ jobs:
pnpm i --frozen-lockfile
- name: Install Playwright browser ${{ matrix.playwright-browser }}
working-directory: ${{ env.frontend-directory }}
run: npx playwright install --with-deps ${{ matrix.playwright-browser }}
run: pnpm exec playwright install --with-deps ${{ matrix.playwright-browser }}
- name: Create frontend environment variables file
working-directory: ${{ env.frontend-directory }}
run: |
Expand Down Expand Up @@ -97,9 +98,12 @@ jobs:
export $(grep -v '^#' .env | xargs)
python manage.py createsuperuser --noinput
nohup python manage.py runserver &
- name: Build frontend
working-directory: ${{ env.frontend-directory }}
run: pnpm run build
- name: Run tests with browser ${{ matrix.playwright-browser }}
working-directory: ${{ env.frontend-directory }}
run: npx playwright test --project=${{ matrix.playwright-browser }}
run: pnpm exec playwright test --project=${{ matrix.playwright-browser }}
env:
CI: true
- uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -154,12 +158,12 @@ jobs:
- name: Install enterprise backend
working-directory: ${{ env.enterprise-backend-directory }}
run: poetry install
- name: Install frontend dependencies
- name: Build enterprise frontend
working-directory: ${{ env.enterprise-frontend-directory }}
run: make pre-build
- name: Install Playwright Browsers
run: make
- name: Install Playwright browser ${{ matrix.playwright-browser }}
working-directory: ${{ env.enterprise-frontend-build-directory }}
run: npx playwright install --with-deps
run: pnpm exec playwright install --with-deps ${{ matrix.playwright-browser }}
- name: Create frontend environment variables file
working-directory: ${{ env.enterprise-frontend-build-directory }}
run: |
Expand Down Expand Up @@ -197,7 +201,7 @@ jobs:
nohup poetry run python manage.py runserver --settings=${{ env.enterprise-backend-settings-module }} &
- name: Run tests with browser ${{ matrix.playwright-browser }}
working-directory: ${{ env.enterprise-frontend-build-directory }}
run: npx playwright test --project=${{ matrix.playwright-browser }}
run: pnpm exec playwright test --project=${{ matrix.playwright-browser }}
env:
CI: true
- uses: actions/upload-artifact@v4
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/startup-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
pnpm i --frozen-lockfile
- name: Install Playwright Browsers
working-directory: ${{ env.frontend-directory }}
run: npx playwright install --with-deps
run: pnpm exec playwright install
- name: Create frontend environment variables file
working-directory: ${{ env.frontend-directory }}
run: |
Expand Down Expand Up @@ -87,9 +87,12 @@ jobs:
export $(grep -v '^#' .env | xargs)
poetry run python manage.py createsuperuser --noinput
nohup poetry run python manage.py runserver &
- name: Build frontend
working-directory: ${{ env.frontend-directory }}
run: pnpm run build
- name: Run tests
working-directory: ${{ env.frontend-directory }}
run: npx playwright test tests/functional/startup.test.ts
run: pnpm exec playwright test tests/functional/startup.test.ts
- uses: actions/upload-artifact@v4
if: always()
with:
Expand All @@ -114,7 +117,7 @@ jobs:
pnpm i --frozen-lockfile
- name: Install Playwright Browsers
working-directory: ${{ env.frontend-directory }}
run: npx playwright install --with-deps
run: pnpm exec playwright install
- name: Build the Docker app
run: docker compose -f docker-compose-build.yml up -d
- name: Create backend environment variables file
Expand Down Expand Up @@ -178,12 +181,12 @@ jobs:
- name: Install enterprise backend
working-directory: ${{ env.enterprise-backend-directory }}
run: poetry install
- name: Install frontend dependencies
- name: Build enterprise frontend
working-directory: ${{ env.enterprise-frontend-directory }}
run: make pre-build
run: make
- name: Install Playwright Browsers
working-directory: ${{ env.enterprise-frontend-build-directory }}
run: npx playwright install --with-deps
run: pnpm exec playwright install
- name: Create frontend environment variables file
working-directory: ${{ env.enterprise-frontend-build-directory }}
run: |
Expand Down Expand Up @@ -216,7 +219,7 @@ jobs:
nohup poetry run python manage.py runserver --settings=${{ env.enterprise-backend-settings-module }} &
- name: Run tests
working-directory: ${{ env.enterprise-frontend-build-directory }}
run: npx playwright test tests/functional/startup.test.ts
run: pnpm exec playwright test tests/functional/startup.test.ts
- uses: actions/upload-artifact@v4
if: always()
with:
Expand All @@ -239,7 +242,7 @@ jobs:
run: make pre-build
- name: Install Playwright Browsers
working-directory: ${{ env.enterprise-frontend-build-directory }}
run: npx playwright install --with-deps
run: pnpm exec playwright install
- name: Build the Docker app
run: docker compose -f enterprise/docker-compose-build.yml up -d
- name: Create backend environment variables file
Expand Down

0 comments on commit 8c0185a

Please sign in to comment.