Skip to content

Commit 85a2f92

Browse files
authored
test(e2e): crc-extension e2e tests runner for mac (#482)
Signed-off-by: Daniel Villanueva <[email protected]>
1 parent 327a18b commit 85a2f92

File tree

2 files changed

+125
-71
lines changed

2 files changed

+125
-71
lines changed

.github/workflows/e2e-main.yml

Lines changed: 70 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -45,56 +45,51 @@ jobs:
4545
strategy:
4646
fail-fast: false
4747
matrix:
48-
os: [windows-2022, ubuntu-24.04] #, macos-14
48+
os: [windows-2022, ubuntu-24.04, macos-14]
4949
runs-on: ${{ matrix.os }}
5050
env:
5151
SKIP_INSTALLATION: true
5252
steps:
53-
# Checkout crc extension
54-
- uses: actions/checkout@v4
53+
54+
- name: Checkout crc extension
55+
uses: actions/checkout@v4
5556
with:
5657
path: crc-extension
5758

58-
# Checkout podman desktop
59-
- uses: actions/checkout@v4
59+
- name: Checkout podman desktop
60+
uses: actions/checkout@v4
6061
with:
61-
repository: containers/podman-desktop
62+
repository: podman-desktop/podman-desktop
6263
ref: main
6364
path: podman-desktop
6465

65-
# Checkout sso extension
66-
- uses: actions/checkout@v4
67-
if: matrix.os == 'windows-2022'
66+
- name: Checkout sso extension (crc-extension dependency)
67+
uses: actions/checkout@v4
68+
if: matrix.os == 'windows-2022' || matrix.os == 'macos-14'
6869
with:
6970
repository: redhat-developer/podman-desktop-redhat-account-ext
7071
ref: main
7172
path: sso-extension
7273

73-
- uses: actions/setup-node@v4
74+
- name: Install node
75+
uses: actions/setup-node@v4
7476
with:
7577
node-version: 20
7678

77-
- uses: pnpm/action-setup@v4
78-
name: Install pnpm
79+
- name: Install pnpm
80+
uses: pnpm/action-setup@v4
7981
with:
8082
run_install: false
8183
package_json_file: ./podman-desktop/package.json
8284

83-
- name: Install Podman Desktop dependencies
84-
working-directory: ./podman-desktop
85-
run: pnpm install
86-
87-
- name: Install SSO extension dependencies
88-
if: matrix.os == 'windows-2022'
89-
working-directory: ./sso-extension
90-
run: pnpm install
91-
92-
- name: Build Podman Desktop for E2E tests
85+
- name: Install & build Podman Desktop for E2E tests
9386
working-directory: ./podman-desktop
94-
run: pnpm test:e2e:build
87+
run: |
88+
pnpm install
89+
pnpm test:e2e:build
9590
96-
- name: Ensure getting current HEAD version of the test framework (ubuntu)
97-
if: matrix.os == 'ubuntu-24.04'
91+
- name: Ensure getting current HEAD version of the test framework (Ubuntu/MacOS)
92+
if: matrix.os == 'ubuntu-24.04' || matrix.os == 'macos-14'
9893
working-directory: ./crc-extension
9994
run: |
10095
# workaround for https://github.com/containers/podman-desktop-extension-bootc/issues/712
@@ -124,22 +119,33 @@ jobs:
124119

125120
- name: Install CRC extension dependencies
126121
working-directory: ./crc-extension
127-
run: yarn install --check-files
128-
129-
- name: Execute yarn in OpenShift Local Extension
130-
working-directory: ./crc-extension
131-
run: yarn --frozen-lockfile
122+
run: |
123+
# workaround for https://github.com/containers/podman-desktop-extension-bootc/issues/712
124+
# Install scoop installer
125+
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
126+
scoop --version
127+
# Install jq using scoop
128+
scoop install jq
129+
# Fetch the version of the npm package
130+
$version = npm view @podman-desktop/tests-playwright@next version
131+
Write-Host "Version of @podman-desktop/tests-playwright to be used: $version"
132+
# Update package.json using jq
133+
jq --arg version "$version" '.devDependencies."@podman-desktop/tests-playwright" = $version' package.json > package.json_tmp
134+
# Replace the old package.json with the updated one
135+
Move-Item -Path package.json_tmp -Destination package.json -Force
136+
shell: pwsh
132137

133138
- name: Revert unprivileged user namespace restrictions in Ubuntu 24.04
134139
if: matrix.os == 'ubuntu-24.04'
135140
run: |
136141
# allow unprivileged user namespace
137142
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
138143
139-
- name: Build OpenShift Local extension from container file and SSO dependency (Ubuntu, podman)
144+
- name: Install & build OpenShift Local extension from container file and SSO dependency (Ubuntu, podman)
140145
if: matrix.os == 'ubuntu-24.04'
141146
working-directory: ./crc-extension
142147
run: |
148+
yarn install --check-files
143149
# build crc extension
144150
podman build -t openshift_local_image . -f ./oci/Containerfile.multistage
145151
CONTAINER_ID_CRC=$(podman create localhost/openshift_local_image --entrypoint "")
@@ -156,12 +162,28 @@ jobs:
156162
mv tests/playwright/output/crc-tests-pd/plugins/extension/ tests/playwright/output/crc-tests-pd/plugins/crcextension
157163
tar -xf /tmp/sso_extension.tar -C tests/playwright/output/crc-tests-pd/plugins/
158164
mv tests/playwright/output/crc-tests-pd/plugins/extension/ tests/playwright/output/crc-tests-pd/plugins/ssoextension
159-
160-
- name: Build OpenShift Local extension locally (Windows, docker) #from container file is not available yet
165+
166+
- name: Install & build OpenShift Local extension locally (MacOS) #from container file is not available yet
167+
if: matrix.os == 'macos-14'
168+
shell: bash
169+
working-directory: ./crc-extension
170+
run: |
171+
yarn install --check-files
172+
# -- following https://github.com/crc-org/crc-extension/blob/main/oci/Containerfile.multistage --
173+
# build extension
174+
yarn build
175+
# make expected test folders
176+
mkdir -p tests/playwright/output/crc-tests-pd/plugins/crcextension
177+
mkdir -p tests/playwright/output/crc-tests-pd/plugins/ssoextension
178+
# move necessary files there
179+
cp -R package.json LICENSE icon.png README.md dist tests/playwright/output/crc-tests-pd/plugins/crcextension
180+
181+
- name: Install & build OpenShift Local extension locally (Windows) #from container file is not available yet
161182
if: matrix.os == 'windows-2022'
162183
working-directory: ./crc-extension
163184
shell: pwsh
164185
run: |
186+
yarn install --check-files
165187
# -- following https://github.com/crc-org/crc-extension/blob/main/oci/Containerfile.multistage --
166188
# build extension
167189
yarn build
@@ -172,11 +194,25 @@ jobs:
172194
# move necessary files there
173195
'package.json', 'LICENSE', 'icon.png', 'README.md', 'dist' | % { cp $_ ./tests/playwright/output/crc-tests-pd/plugins/crcextension -Recurse -Force}
174196
175-
- name: Build SSO extension (crc dependency) locally (Windows, docker) #from container file is not available yet
197+
- name: Install & build SSO extension (crc dependency) locally (MacOS) #from container file is not available yet
198+
if: matrix.os == 'macos-14'
199+
working-directory: ./sso-extension
200+
shell: bash
201+
run: |
202+
pnpm install
203+
# -- following https://github.com/redhat-developer/podman-desktop-redhat-account-ext/blob/main/Containerfile --
204+
# build extension
205+
pnpm build
206+
# put the contents into its expected folder:
207+
mkdir -p ../crc-extension/tests/playwright/output/crc-tests-pd/plugins/ssoextension
208+
cp -R ./builtin/redhat-authentication.cdix/* ../crc-extension/tests/playwright/output/crc-tests-pd/plugins/ssoextension
209+
210+
- name: Install & build SSO extension (crc dependency) locally (Windows) #from container file is not available yet
176211
if: matrix.os == 'windows-2022'
177212
working-directory: ./sso-extension
178213
shell: pwsh
179214
run: |
215+
pnpm install
180216
# -- following https://github.com/redhat-developer/podman-desktop-redhat-account-ext/blob/main/Containerfile --
181217
# build extension
182218
pnpm build

.github/workflows/pr-check.yaml

Lines changed: 55 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -124,56 +124,51 @@ jobs:
124124
strategy:
125125
fail-fast: false
126126
matrix:
127-
os: [windows-2022, ubuntu-24.04] #, macos-14
127+
os: [windows-2022, ubuntu-24.04, macos-14]
128128
runs-on: ${{ matrix.os }}
129129
env:
130130
SKIP_INSTALLATION: true
131131
steps:
132-
# Checkout crc extension
133-
- uses: actions/checkout@v4
132+
133+
- name: Checkout crc extension
134+
uses: actions/checkout@v4
134135
with:
135136
path: crc-extension
136137

137-
# Checkout podman desktop
138-
- uses: actions/checkout@v4
138+
- name: Checkout podman desktop
139+
uses: actions/checkout@v4
139140
with:
140-
repository: containers/podman-desktop
141+
repository: podman-desktop/podman-desktop
141142
ref: main
142143
path: podman-desktop
143144

144-
# Checkout sso extension
145-
- uses: actions/checkout@v4
146-
if: matrix.os == 'windows-2022'
145+
- name: Checkout sso extension (crc-extension dependency)
146+
uses: actions/checkout@v4
147+
if: matrix.os == 'windows-2022' || matrix.os == 'macos-14'
147148
with:
148149
repository: redhat-developer/podman-desktop-redhat-account-ext
149150
ref: main
150151
path: sso-extension
151152

152-
- uses: actions/setup-node@v4
153+
- name: Install node
154+
uses: actions/setup-node@v4
153155
with:
154156
node-version: 20
155157

156-
- uses: pnpm/action-setup@v4
157-
name: Install pnpm
158+
- name: Install pnpm
159+
uses: pnpm/action-setup@v4
158160
with:
159161
run_install: false
160162
package_json_file: ./podman-desktop/package.json
161163

162-
- name: Install Podman Desktop dependencies
164+
- name: Install & build Podman Desktop for E2E tests
163165
working-directory: ./podman-desktop
164-
run: pnpm install
165-
166-
- name: Install SSO extension dependencies
167-
if: matrix.os == 'windows-2022'
168-
working-directory: ./sso-extension
169-
run: pnpm install
170-
171-
- name: Build Podman Desktop for E2E tests
172-
working-directory: ./podman-desktop
173-
run: pnpm test:e2e:build
166+
run: |
167+
pnpm install
168+
pnpm test:e2e:build
174169
175-
- name: Ensure getting current HEAD version of the test framework (ubuntu)
176-
if: matrix.os == 'ubuntu-24.04'
170+
- name: Ensure getting current HEAD version of the test framework (Ubuntu/MacOS)
171+
if: matrix.os == 'ubuntu-24.04' || matrix.os == 'macos-14'
177172
working-directory: ./crc-extension
178173
run: |
179174
# workaround for https://github.com/containers/podman-desktop-extension-bootc/issues/712
@@ -201,24 +196,17 @@ jobs:
201196
Move-Item -Path package.json_tmp -Destination package.json -Force
202197
shell: pwsh
203198

204-
- name: Install CRC extension dependencies
205-
working-directory: ./crc-extension
206-
run: yarn install --check-files
207-
208-
- name: Execute yarn in OpenShift Local Extension
209-
working-directory: ./crc-extension
210-
run: yarn --frozen-lockfile
211-
212199
- name: Revert unprivileged user namespace restrictions in Ubuntu 24.04
213200
if: matrix.os == 'ubuntu-24.04'
214201
run: |
215202
# allow unprivileged user namespace
216203
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
217204
218-
- name: Build OpenShift Local extension from container file and SSO dependency (Ubuntu, podman)
205+
- name: Install & build OpenShift Local extension from container file and SSO dependency (Ubuntu, podman)
219206
if: matrix.os == 'ubuntu-24.04'
220207
working-directory: ./crc-extension
221208
run: |
209+
yarn install --check-files
222210
# build crc extension
223211
podman build -t openshift_local_image . -f ./oci/Containerfile.multistage
224212
CONTAINER_ID_CRC=$(podman create localhost/openshift_local_image --entrypoint "")
@@ -235,12 +223,28 @@ jobs:
235223
mv tests/playwright/output/crc-tests-pd/plugins/extension/ tests/playwright/output/crc-tests-pd/plugins/crcextension
236224
tar -xf /tmp/sso_extension.tar -C tests/playwright/output/crc-tests-pd/plugins/
237225
mv tests/playwright/output/crc-tests-pd/plugins/extension/ tests/playwright/output/crc-tests-pd/plugins/ssoextension
238-
239-
- name: Build OpenShift Local extension locally (Windows, docker) #from container file is not available yet
226+
227+
- name: Install & build OpenShift Local extension locally (MacOS) #from container file is not available yet
228+
if: matrix.os == 'macos-14'
229+
shell: bash
230+
working-directory: ./crc-extension
231+
run: |
232+
yarn install --check-files
233+
# -- following https://github.com/crc-org/crc-extension/blob/main/oci/Containerfile.multistage --
234+
# build extension
235+
yarn build
236+
# make expected test folders
237+
mkdir -p tests/playwright/output/crc-tests-pd/plugins/crcextension
238+
mkdir -p tests/playwright/output/crc-tests-pd/plugins/ssoextension
239+
# move necessary files there
240+
cp -R package.json LICENSE icon.png README.md dist tests/playwright/output/crc-tests-pd/plugins/crcextension
241+
242+
- name: Install & build OpenShift Local extension locally (Windows) #from container file is not available yet
240243
if: matrix.os == 'windows-2022'
241244
working-directory: ./crc-extension
242245
shell: pwsh
243246
run: |
247+
yarn install --check-files
244248
# -- following https://github.com/crc-org/crc-extension/blob/main/oci/Containerfile.multistage --
245249
# build extension
246250
yarn build
@@ -251,11 +255,25 @@ jobs:
251255
# move necessary files there
252256
'package.json', 'LICENSE', 'icon.png', 'README.md', 'dist' | % { cp $_ ./tests/playwright/output/crc-tests-pd/plugins/crcextension -Recurse -Force}
253257
254-
- name: Build SSO extension (crc dependency) locally (Windows, docker) #from container file is not available yet
258+
- name: Install & build SSO extension (crc dependency) locally (MacOS) #from container file is not available yet
259+
if: matrix.os == 'macos-14'
260+
working-directory: ./sso-extension
261+
shell: bash
262+
run: |
263+
pnpm install
264+
# -- following https://github.com/redhat-developer/podman-desktop-redhat-account-ext/blob/main/Containerfile --
265+
# build extension
266+
pnpm build
267+
# put the contents into its expected folder:
268+
mkdir -p ../crc-extension/tests/playwright/output/crc-tests-pd/plugins/ssoextension
269+
cp -R ./builtin/redhat-authentication.cdix/* ../crc-extension/tests/playwright/output/crc-tests-pd/plugins/ssoextension
270+
271+
- name: Install & build SSO extension (crc dependency) locally (Windows) #from container file is not available yet
255272
if: matrix.os == 'windows-2022'
256273
working-directory: ./sso-extension
257274
shell: pwsh
258275
run: |
276+
pnpm install
259277
# -- following https://github.com/redhat-developer/podman-desktop-redhat-account-ext/blob/main/Containerfile --
260278
# build extension
261279
pnpm build

0 commit comments

Comments
 (0)