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

test(e2e): crc-extension e2e tests runner for mac #482

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
107 changes: 72 additions & 35 deletions .github/workflows/e2e-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,56 +45,51 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-2022, ubuntu-24.04] #, macos-14
os: [windows-2022, ubuntu-24.04, macos-14]
runs-on: ${{ matrix.os }}
env:
SKIP_INSTALLATION: true
steps:
# Checkout crc extension
- uses: actions/checkout@v4

- name: Checkout crc extension
uses: actions/checkout@v4
with:
path: crc-extension

# Checkout podman desktop
- uses: actions/checkout@v4
- name: Checkout podman desktop
uses: actions/checkout@v4
with:
repository: containers/podman-desktop
repository: podman-desktop/podman-desktop
ref: main
path: podman-desktop

# Checkout sso extension
- uses: actions/checkout@v4
if: matrix.os == 'windows-2022'
- name: Checkout sso extension (crc-extension dependency)
uses: actions/checkout@v4
if: matrix.os == 'windows-2022' || matrix.os == 'macos-14'
with:
repository: redhat-developer/podman-desktop-redhat-account-ext
ref: main
path: sso-extension

- uses: actions/setup-node@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v4
name: Install pnpm
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
package_json_file: ./podman-desktop/package.json

- name: Install Podman Desktop dependencies
- name: Install & build Podman Desktop for E2E tests
working-directory: ./podman-desktop
run: pnpm install

- name: Install SSO extension dependencies
if: matrix.os == 'windows-2022'
working-directory: ./sso-extension
run: pnpm install

- name: Build Podman Desktop for E2E tests
working-directory: ./podman-desktop
run: pnpm test:e2e:build
run: |
pnpm install
pnpm test:e2e:build

- name: Ensure getting current HEAD version of the test framework (ubuntu)
if: matrix.os == 'ubuntu-24.04'
- name: Ensure getting current HEAD version of the test framework (Ubuntu/MacOS)
if: matrix.os == 'ubuntu-24.04' || matrix.os == 'macos-14'
working-directory: ./crc-extension
run: |
# workaround for https://github.com/containers/podman-desktop-extension-bootc/issues/712
Expand All @@ -103,24 +98,36 @@ jobs:
jq --arg version "$version" '.devDependencies."@podman-desktop/tests-playwright" = $version' package.json > package.json_tmp && mv package.json_tmp package.json
shell: bash

- name: Install CRC extension dependencies
- name: Ensure getting current HEAD version of the test framework (Windows)
if: matrix.os == 'windows-2022'
working-directory: ./crc-extension
run: yarn install --check-files

- name: Execute yarn in OpenShift Local Extension
working-directory: ./crc-extension
run: yarn --frozen-lockfile
run: |
# workaround for https://github.com/containers/podman-desktop-extension-bootc/issues/712
# Install scoop installer
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
scoop --version
# Install jq using scoop
scoop install jq
# Fetch the version of the npm package
$version = npm view @podman-desktop/tests-playwright@next version
Write-Host "Version of @podman-desktop/tests-playwright to be used: $version"
# Update package.json using jq
jq --arg version "$version" '.devDependencies."@podman-desktop/tests-playwright" = $version' package.json > package.json_tmp
# Replace the old package.json with the updated one
Move-Item -Path package.json_tmp -Destination package.json -Force
shell: pwsh

- name: Revert unprivileged user namespace restrictions in Ubuntu 24.04
if: matrix.os == 'ubuntu-24.04'
run: |
# allow unprivileged user namespace
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0

- name: Build OpenShift Local extension from container file and SSO dependency (Ubuntu, podman)
- name: Install & build OpenShift Local extension from container file and SSO dependency (Ubuntu, podman)
if: matrix.os == 'ubuntu-24.04'
working-directory: ./crc-extension
run: |
yarn install --check-files
# build crc extension
podman build -t openshift_local_image . -f ./oci/Containerfile.multistage
CONTAINER_ID_CRC=$(podman create localhost/openshift_local_image --entrypoint "")
Expand All @@ -137,12 +144,28 @@ jobs:
mv tests/playwright/output/crc-tests-pd/plugins/extension/ tests/playwright/output/crc-tests-pd/plugins/crcextension
tar -xf /tmp/sso_extension.tar -C tests/playwright/output/crc-tests-pd/plugins/
mv tests/playwright/output/crc-tests-pd/plugins/extension/ tests/playwright/output/crc-tests-pd/plugins/ssoextension

- name: Build OpenShift Local extension locally (Windows, docker) #from container file is not available yet

- name: Install & build OpenShift Local extension locally (MacOS) #from container file is not available yet
if: matrix.os == 'macos-14'
shell: bash
working-directory: ./crc-extension
run: |
yarn install --check-files
# -- following https://github.com/crc-org/crc-extension/blob/main/oci/Containerfile.multistage --
# build extension
yarn build
# make expected test folders
mkdir -p tests/playwright/output/crc-tests-pd/plugins/crcextension
mkdir -p tests/playwright/output/crc-tests-pd/plugins/ssoextension
# move necessary files there
cp -R package.json LICENSE icon.png README.md dist tests/playwright/output/crc-tests-pd/plugins/crcextension

- name: Install & build OpenShift Local extension locally (Windows) #from container file is not available yet
if: matrix.os == 'windows-2022'
working-directory: ./crc-extension
shell: pwsh
run: |
yarn install --check-files
# -- following https://github.com/crc-org/crc-extension/blob/main/oci/Containerfile.multistage --
# build extension
yarn build
Expand All @@ -153,11 +176,25 @@ jobs:
# move necessary files there
'package.json', 'LICENSE', 'icon.png', 'README.md', 'dist' | % { cp $_ ./tests/playwright/output/crc-tests-pd/plugins/crcextension -Recurse -Force}

- name: Build SSO extension (crc dependency) locally (Windows, docker) #from container file is not available yet
- name: Install & build SSO extension (crc dependency) locally (MacOS) #from container file is not available yet
if: matrix.os == 'macos-14'
working-directory: ./sso-extension
shell: bash
run: |
pnpm install
# -- following https://github.com/redhat-developer/podman-desktop-redhat-account-ext/blob/main/Containerfile --
# build extension
pnpm build
# put the contents into its expected folder:
mkdir -p ../crc-extension/tests/playwright/output/crc-tests-pd/plugins/ssoextension
cp -R ./builtin/redhat-authentication.cdix/* ../crc-extension/tests/playwright/output/crc-tests-pd/plugins/ssoextension

- name: Install & build SSO extension (crc dependency) locally (Windows) #from container file is not available yet
if: matrix.os == 'windows-2022'
working-directory: ./sso-extension
shell: pwsh
run: |
pnpm install
# -- following https://github.com/redhat-developer/podman-desktop-redhat-account-ext/blob/main/Containerfile --
# build extension
pnpm build
Expand Down
92 changes: 55 additions & 37 deletions .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,56 +124,51 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-2022, ubuntu-24.04] #, macos-14
os: [windows-2022, ubuntu-24.04, macos-14]
runs-on: ${{ matrix.os }}
env:
SKIP_INSTALLATION: true
steps:
# Checkout crc extension
- uses: actions/checkout@v4

- name: Checkout crc extension
uses: actions/checkout@v4
with:
path: crc-extension

# Checkout podman desktop
- uses: actions/checkout@v4
- name: Checkout podman desktop
uses: actions/checkout@v4
with:
repository: containers/podman-desktop
repository: podman-desktop/podman-desktop
ref: main
path: podman-desktop

# Checkout sso extension
- uses: actions/checkout@v4
if: matrix.os == 'windows-2022'
- name: Checkout sso extension (crc-extension dependency)
uses: actions/checkout@v4
if: matrix.os == 'windows-2022' || matrix.os == 'macos-14'
with:
repository: redhat-developer/podman-desktop-redhat-account-ext
ref: main
path: sso-extension

- uses: actions/setup-node@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v4
name: Install pnpm
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
package_json_file: ./podman-desktop/package.json

- name: Install Podman Desktop dependencies
- name: Install & build Podman Desktop for E2E tests
working-directory: ./podman-desktop
run: pnpm install

- name: Install SSO extension dependencies
if: matrix.os == 'windows-2022'
working-directory: ./sso-extension
run: pnpm install

- name: Build Podman Desktop for E2E tests
working-directory: ./podman-desktop
run: pnpm test:e2e:build
run: |
pnpm install
pnpm test:e2e:build

- name: Ensure getting current HEAD version of the test framework (ubuntu)
if: matrix.os == 'ubuntu-24.04'
- name: Ensure getting current HEAD version of the test framework (Ubuntu/MacOS)
if: matrix.os == 'ubuntu-24.04' || matrix.os == 'macos-14'
working-directory: ./crc-extension
run: |
# workaround for https://github.com/containers/podman-desktop-extension-bootc/issues/712
Expand Down Expand Up @@ -201,24 +196,17 @@ jobs:
Move-Item -Path package.json_tmp -Destination package.json -Force
shell: pwsh

- name: Install CRC extension dependencies
working-directory: ./crc-extension
run: yarn install --check-files

- name: Execute yarn in OpenShift Local Extension
working-directory: ./crc-extension
run: yarn --frozen-lockfile

- name: Revert unprivileged user namespace restrictions in Ubuntu 24.04
if: matrix.os == 'ubuntu-24.04'
run: |
# allow unprivileged user namespace
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0

- name: Build OpenShift Local extension from container file and SSO dependency (Ubuntu, podman)
- name: Install & build OpenShift Local extension from container file and SSO dependency (Ubuntu, podman)
if: matrix.os == 'ubuntu-24.04'
working-directory: ./crc-extension
run: |
yarn install --check-files
# build crc extension
podman build -t openshift_local_image . -f ./oci/Containerfile.multistage
CONTAINER_ID_CRC=$(podman create localhost/openshift_local_image --entrypoint "")
Expand All @@ -235,12 +223,28 @@ jobs:
mv tests/playwright/output/crc-tests-pd/plugins/extension/ tests/playwright/output/crc-tests-pd/plugins/crcextension
tar -xf /tmp/sso_extension.tar -C tests/playwright/output/crc-tests-pd/plugins/
mv tests/playwright/output/crc-tests-pd/plugins/extension/ tests/playwright/output/crc-tests-pd/plugins/ssoextension

- name: Build OpenShift Local extension locally (Windows, docker) #from container file is not available yet

- name: Install & build OpenShift Local extension locally (MacOS) #from container file is not available yet
if: matrix.os == 'macos-14'
shell: bash
working-directory: ./crc-extension
run: |
yarn install --check-files
# -- following https://github.com/crc-org/crc-extension/blob/main/oci/Containerfile.multistage --
# build extension
yarn build
# make expected test folders
mkdir -p tests/playwright/output/crc-tests-pd/plugins/crcextension
mkdir -p tests/playwright/output/crc-tests-pd/plugins/ssoextension
# move necessary files there
cp -R package.json LICENSE icon.png README.md dist tests/playwright/output/crc-tests-pd/plugins/crcextension

- name: Install & build OpenShift Local extension locally (Windows) #from container file is not available yet
if: matrix.os == 'windows-2022'
working-directory: ./crc-extension
shell: pwsh
run: |
yarn install --check-files
# -- following https://github.com/crc-org/crc-extension/blob/main/oci/Containerfile.multistage --
# build extension
yarn build
Expand All @@ -251,11 +255,25 @@ jobs:
# move necessary files there
'package.json', 'LICENSE', 'icon.png', 'README.md', 'dist' | % { cp $_ ./tests/playwright/output/crc-tests-pd/plugins/crcextension -Recurse -Force}

- name: Build SSO extension (crc dependency) locally (Windows, docker) #from container file is not available yet
- name: Install & build SSO extension (crc dependency) locally (MacOS) #from container file is not available yet
if: matrix.os == 'macos-14'
working-directory: ./sso-extension
shell: bash
run: |
pnpm install
# -- following https://github.com/redhat-developer/podman-desktop-redhat-account-ext/blob/main/Containerfile --
# build extension
pnpm build
# put the contents into its expected folder:
mkdir -p ../crc-extension/tests/playwright/output/crc-tests-pd/plugins/ssoextension
cp -R ./builtin/redhat-authentication.cdix/* ../crc-extension/tests/playwright/output/crc-tests-pd/plugins/ssoextension

- name: Install & build SSO extension (crc dependency) locally (Windows) #from container file is not available yet
if: matrix.os == 'windows-2022'
working-directory: ./sso-extension
shell: pwsh
run: |
pnpm install
# -- following https://github.com/redhat-developer/podman-desktop-redhat-account-ext/blob/main/Containerfile --
# build extension
pnpm build
Expand Down