Skip to content

Commit fb076e9

Browse files
committed
Support restructured OpenLens repo in integration test
1 parent f38c3a7 commit fb076e9

File tree

3 files changed

+34
-11
lines changed

3 files changed

+34
-11
lines changed

.github/workflows/test.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ jobs:
4646
include:
4747
- lens-ref: HEAD
4848
node-version: 16
49-
- lens-ref: v6.4.0-alpha.4
50-
node-version: 16
51-
- lens-ref: v6.4.0-alpha.3
49+
script: tools/integration_test.sh
50+
- lens-ref: v6.4.0-beta.5
5251
node-version: 16
53-
- lens-ref: v6.4.0-alpha.2
54-
node-version: 16
55-
- lens-ref: v6.4.0-alpha.1
52+
script: tools/integration_test.sh
53+
- lens-ref: v6.4.0-alpha.4
5654
node-version: 16
55+
script: tools/integration_test_pre6.4.0.sh
5756
- lens-ref: v6.3.0
5857
node-version: 16
58+
script: tools/integration_test_pre6.4.0.sh
5959
steps:
6060
- name: Check out repository
6161
uses: actions/checkout@v3
@@ -78,4 +78,4 @@ jobs:
7878

7979
- name: Run integration test
8080
run: |-
81-
EXTENSION_PATH="$(realpath out/$(ls -1 out))" LENS_REF="${{ matrix.lens-ref }}" xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' tools/integration_test.sh
81+
EXTENSION_PATH="$(realpath out/$(ls -1 out))" LENS_REF="${{ matrix.lens-ref }}" xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' ${{ matrix.script }}

tools/integration_test.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ set -exo pipefail
77
DIR=$(mktemp -d)
88
git clone https://github.com/lensapp/lens ${DIR}/lens
99
[ ! -z "${LENS_REF}" ] && git -C ${DIR}/lens checkout ${LENS_REF}
10-
cp tools/extensions.tests.ts ${DIR}/lens/integration/__tests__/extensions.tests.ts
11-
TARGET_FILE="${DIR}/lens/package.json" node tools/remove_extra_lens_targets.js
10+
cp tools/extensions.tests.ts ${DIR}/lens/packages/open-lens/integration/__tests__/extensions.tests.ts
11+
TARGET_FILE="${DIR}/lens/packages/open-lens/package.json" node tools/remove_extra_lens_targets.js
1212

1313
pushd ${DIR}/lens
14-
make build
15-
npx jest -- integration/__tests__/extensions.tests.ts
14+
yarn install --frozen-lockfile
15+
yarn run build:app
16+
17+
# If left present, the snap package will be mistaken for an obsolete Jest snapshot
18+
rm packages/open-lens/dist/*.snap
19+
20+
cd packages/open-lens && npx jest -- integration/__tests__/extensions.tests.ts
1621
popd
1722

1823
rm -rf ${DIR}

tools/integration_test_pre6.4.0.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
set -exo pipefail
4+
5+
[ -z "${EXTENSION_PATH}" ] && echo "EXTENSION_PATH environment variable must be set" && exit 1
6+
7+
DIR=$(mktemp -d)
8+
git clone https://github.com/lensapp/lens ${DIR}/lens
9+
[ ! -z "${LENS_REF}" ] && git -C ${DIR}/lens checkout ${LENS_REF}
10+
cp tools/extensions.tests.ts ${DIR}/lens/integration/__tests__/extensions.tests.ts
11+
TARGET_FILE="${DIR}/lens/package.json" node tools/remove_extra_lens_targets.js
12+
13+
pushd ${DIR}/lens
14+
make build
15+
npx jest -- integration/__tests__/extensions.tests.ts
16+
popd
17+
18+
rm -rf ${DIR}

0 commit comments

Comments
 (0)