1
1
#
2
- # Copyright (C) 2022 Red Hat, Inc.
2
+ # Copyright (C) 2022-2024 Red Hat, Inc.
3
3
#
4
4
# Licensed under the Apache License, Version 2.0 (the "License");
5
5
# you may not use this file except in compliance with the License.
@@ -117,4 +117,83 @@ jobs:
117
117
run : yarn format:check
118
118
119
119
- name : Run Tests
120
- run : yarn test
120
+ run : yarn test
121
+
122
+ e2e-tests :
123
+ name : e2e tests
124
+ runs-on : ubuntu-24.04 # 20.04?
125
+ env :
126
+ SKIP_INSTALLATION : true
127
+ steps :
128
+ - uses : actions/checkout@v4
129
+ with :
130
+ path : crc-extension
131
+
132
+ # Checkout podman desktop
133
+ - uses : actions/checkout@v4
134
+ with :
135
+ repository : containers/podman-desktop
136
+ ref : main
137
+ path : podman-desktop
138
+
139
+ - uses : actions/setup-node@v4
140
+ with :
141
+ node-version : 20
142
+
143
+ - uses : pnpm/action-setup@v4
144
+ name : Install pnpm
145
+ with :
146
+ run_install : false
147
+ package_json_file : ./podman-desktop/package.json
148
+
149
+ - name : Execute pnpm
150
+ working-directory : ./podman-desktop
151
+ run : pnpm install
152
+
153
+ - name : Build Podman Desktop for E2E tests
154
+ working-directory : ./podman-desktop
155
+ run : pnpm test:e2e:build
156
+
157
+ - name : Ensure getting current HEAD version of the test framework
158
+ working-directory : ./crc-extension
159
+ run : |
160
+ # workaround for https://github.com/containers/podman-desktop-extension-bootc/issues/712
161
+ version=$(npm view @podman-desktop/tests-playwright@next version)
162
+ echo "Version of @podman-desktop/tests-playwright to be used: $version"
163
+ jq --arg version "$version" '.devDependencies."@podman-desktop/tests-playwright" = $version' package.json > package.json_tmp && mv package.json_tmp package.json
164
+
165
+ - name : Execute yarn in OpenShift Local Extension
166
+ working-directory : ./crc-extension
167
+ run : yarn
168
+
169
+ - name : Revert unprivileged user namespace restrictions in Ubuntu 24.04
170
+ run : |
171
+ # allow unprivileged user namespace
172
+ sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
173
+
174
+ - name : Build OpenShift Local extension from container file
175
+ working-directory : ./crc-extension
176
+ run : |
177
+ podman build -t openshift_local_image . -f ./oci/Containerfile.multistage
178
+ CONTAINER_ID_CRC=$(podman create localhost/openshift_local_image --entrypoint "")
179
+ podman export $CONTAINER_ID_CRC > /tmp/openshift_local_extension.tar
180
+ mkdir -p tests/playwright/output/crc-tests-pd/plugins
181
+ podman pull ghcr.io/redhat-developer/podman-desktop-redhat-account-ext:latest
182
+ CONTAINER_ID_SSO=$(podman create ghcr.io/redhat-developer/podman-desktop-redhat-account-ext --entrypoint "")
183
+ podman export $CONTAINER_ID_SSO > /tmp/sso_extension.tar
184
+ tar -xf /tmp/openshift_local_extension.tar -C tests/playwright/output/crc-tests-pd/plugins/
185
+ mv tests/playwright/output/crc-tests-pd/plugins/extension/ tests/playwright/output/crc-tests-pd/plugins/crcextension
186
+ tar -xf /tmp/sso_extension.tar -C tests/playwright/output/crc-tests-pd/plugins/
187
+ mv tests/playwright/output/crc-tests-pd/plugins/extension/ tests/playwright/output/crc-tests-pd/plugins/ssoextension
188
+
189
+ - name : Run All E2E tests
190
+ working-directory : ./crc-extension
191
+ env :
192
+ PODMAN_DESKTOP_ARGS : ${{ github.workspace }}/podman-desktop
193
+ run : yarn test:e2e
194
+
195
+ - uses : actions/upload-artifact@v4
196
+ if : always()
197
+ with :
198
+ name : e2e-tests
199
+ path : ./**/tests/**/output/
0 commit comments