Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI Playwright improvements #890

Merged
merged 7 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
6 changes: 3 additions & 3 deletions enterprise/frontend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ pre-build: ensure-pnpm

build-enterprise: pre-build
@$(PM) run -C $(FRONTEND_DIR) build
@mv $(FRONTEND_DIR)/build $(ENTERPRISE_DIR)/build
@mv $(FRONTEND_DIR)/node_modules $(ENTERPRISE_DIR)/node_modules
@mv $(FRONTEND_DIR)/package.json $(ENTERPRISE_DIR)/package.json
@rsync -av $(FRONTEND_DIR)/build $(ENTERPRISE_DIR)/build
@rsync -av $(FRONTEND_DIR)/node_modules $(ENTERPRISE_DIR)/node_modules
@rsync -av $(FRONTEND_DIR)/package.json $(ENTERPRISE_DIR)/package.json

CHANGED_FILES =

Expand Down
Loading
Loading