Skip to content

Commit

Permalink
test(e2e): crc-extension e2e tests runner for mac
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Villanueva <[email protected]>
  • Loading branch information
danivilla9 committed Jan 15, 2025
1 parent 15a4721 commit 400ad18
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 16 deletions.
61 changes: 53 additions & 8 deletions .github/workflows/e2e-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ 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
Expand All @@ -64,7 +64,7 @@ jobs:

# Checkout sso extension
- uses: actions/checkout@v4
if: matrix.os == 'windows-2022'
if: matrix.os == 'windows-2022' || matrix.os == 'macos-14'
with:
repository: redhat-developer/podman-desktop-redhat-account-ext
ref: main
Expand All @@ -85,16 +85,16 @@ jobs:
run: pnpm install

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

- name: Build Podman Desktop for E2E tests
working-directory: ./podman-desktop
run: 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,6 +103,25 @@ 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: Ensure getting current HEAD version of the test framework (Windows)
if: matrix.os == 'windows-2022'
working-directory: ./crc-extension
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: Install CRC extension dependencies
working-directory: ./crc-extension
run: yarn install --check-files
Expand Down Expand Up @@ -137,8 +156,22 @@ 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: 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: |
# -- 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: Build OpenShift Local extension locally (Windows) #from container file is not available yet
if: matrix.os == 'windows-2022'
working-directory: ./crc-extension
shell: pwsh
Expand All @@ -153,7 +186,19 @@ 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: 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: |
# -- 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: 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
Expand Down
42 changes: 34 additions & 8 deletions .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ 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
Expand All @@ -143,7 +143,7 @@ jobs:

# Checkout sso extension
- uses: actions/checkout@v4
if: matrix.os == 'windows-2022'
if: matrix.os == 'windows-2022' || matrix.os == 'macos-14'
with:
repository: redhat-developer/podman-desktop-redhat-account-ext
ref: main
Expand All @@ -164,16 +164,16 @@ jobs:
run: pnpm install

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

- name: Build Podman Desktop for E2E tests
working-directory: ./podman-desktop
run: 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 @@ -235,8 +235,22 @@ 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: 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: |
# -- 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: Build OpenShift Local extension locally (Windows) #from container file is not available yet
if: matrix.os == 'windows-2022'
working-directory: ./crc-extension
shell: pwsh
Expand All @@ -251,7 +265,19 @@ 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: 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: |
# -- 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: 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
Expand Down

0 comments on commit 400ad18

Please sign in to comment.