Skip to content

Commit

Permalink
chore(ci): adding e2e test on ubuntu runner into prcheck (#1727)
Browse files Browse the repository at this point in the history
* chore(ci): adding e2e test on ubuntu runner into prcheck

Signed-off-by: Tibor Dancs <[email protected]>

* chore(ci): pr-review fixes

Signed-off-by: Tibor Dancs <[email protected]>

---------

Signed-off-by: Tibor Dancs <[email protected]>
  • Loading branch information
ScrewTSW committed Sep 17, 2024
1 parent 0045a65 commit 00b6c89
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/workflows/e2e-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ jobs:
working-directory: ./podman-desktop-extension-ai-lab
env:
PODMAN_DESKTOP_ARGS: ${{ github.workspace }}/podman-desktop
AI_LAB_CI_RUN: true
run: pnpm test:e2e

- uses: actions/upload-artifact@v4
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,82 @@ jobs:
echo "Found changes in git"
exit 1
fi
e2e-pr-check:
name: e2e tests smoke
runs-on: ubuntu-24.04
env:
SKIP_INSTALLATION: true
steps:
- uses: actions/checkout@v4
with:
path: podman-desktop-extension-ai-lab
# Set up pnpm
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
package_json_file: ./podman-desktop-extension-ai-lab/package.json
# Install Node.js
- uses: actions/setup-node@v4
with:
node-version: 20
# Checkout podman desktop
- uses: actions/checkout@v4
with:
repository: containers/podman-desktop
ref: main
path: podman-desktop

- name: Update podman
run: |
# ubuntu version from kubic repository to install podman we need (v5)
ubuntu_version='23.04'
sudo sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list"
curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/Release.key" | sudo apt-key add -
# install necessary dependencies for criu package which is not part of 23.04
sudo apt-get install -qq libprotobuf32t64 python3-protobuf libnet1
# install criu manually from static location
curl -sLO http://cz.archive.ubuntu.com/ubuntu/pool/universe/c/criu/criu_3.16.1-2_amd64.deb && sudo dpkg -i criu_3.16.1-2_amd64.deb
sudo apt-get update -qq
sudo apt-get -qq -y install podman || { echo "Start fallback steps for podman nightly installation from a static mirror" && \
sudo sh -c "echo 'deb http://ftp.lysator.liu.se/pub/opensuse/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list" && \
curl -L "http://ftp.lysator.liu.se/pub/opensuse/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/Release.key" | sudo apt-key add - && \
sudo apt-get update && \
sudo apt-get -y install podman; }
podman version
- name: Revert unprivileged user namespace restrictions in Ubuntu 24.04
run: |
# allow unprivileged user namespace
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
- name: Install pnpm deps and build Podman Desktop
working-directory: ./podman-desktop
run: |
pnpm install --frozen-lockfile
pnpm test:e2e:build
- name: Ensure getting current HEAD version of the test framework
working-directory: ./podman-desktop-extension-ai-lab/tests/playwright
run: |
# workaround for https://github.com/containers/podman-desktop-extension-bootc/issues/712
version=$(npm view @podman-desktop/tests-playwright@next version)
echo "Version of @podman-desktop/tests-playwright to be used: $version"
jq --arg version "$version" '.devDependencies."@podman-desktop/tests-playwright" = $version' package.json > package.json_tmp && mv package.json_tmp package.json
- name: Execute pnpm in AI Lab Extension
working-directory: ./podman-desktop-extension-ai-lab
run: pnpm install --no-frozen-lockfile

- name: Run E2E Smoke tests
working-directory: ./podman-desktop-extension-ai-lab
env:
PODMAN_DESKTOP_ARGS: ${{ github.workspace }}/podman-desktop
run: pnpm test:e2e:smoke

- uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-pr-check
path: ./**/tests/**/output/
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"test:shared": "vitest run -r packages/shared --passWithNoTests --coverage",
"test:unit": "npm run test:backend && npm run test:shared && npm run test:frontend",
"test:e2e": "cd tests/playwright && npm run test:e2e",
"test:e2e:smoke": "cd tests/playwright && npm run test:e2e:smoke",
"typecheck:shared": "tsc --noEmit --project packages/shared",
"typecheck:frontend": "tsc --noEmit --project packages/frontend",
"typecheck:backend": "cd packages/backend && npm run typecheck",
Expand Down
3 changes: 2 additions & 1 deletion tests/playwright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Podman Desktop AI Lab extension Playwright E2E tests",
"scripts": {
"test:e2e:setup": "xvfb-maybe --auto-servernum --server-args='-screen 0 1280x960x24' --",
"test:e2e": "npm run test:e2e:setup playwright test src/"
"test:e2e": "npm run test:e2e:setup playwright test src/",
"test:e2e:smoke": "npm run test:e2e:setup playwright test src/ --grep @smoke"
},
"author": "Red Hat",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/playwright/src/ai-lab-extension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ test.afterAll(async ({ runner }) => {
await runner.close();
});

test.describe.serial(`AI Lab extension installation and verification`, () => {
test.describe.serial(`AI Lab extension installation and verification`, { tag: '@smoke' }, () => {
test.describe.serial(`AI Lab extension installation`, () => {
test(`Open Settings -> Extensions page`, async () => {
dashboardPage = await navigationBar.openDashboard();
Expand Down

0 comments on commit 00b6c89

Please sign in to comment.