Skip to content

Commit a88d461

Browse files
committed
feat(smoke-tests): switch to startTestBackend, delegate OCI download to install-dynamic-plugins.py
Replace createBackend() with startTestBackend() for a minimal, focused smoke test that only validates dynamic plugin loading. Remove 23 static plugin dependencies and the in-process OCI download logic in favor of the upstream install-dynamic-plugins.py script fetched at CI time. Made-with: Cursor Signed-of-by: rlan@redhat.com
1 parent fca50df commit a88d461

4 files changed

Lines changed: 143 additions & 265 deletions

File tree

.github/workflows/run-workspace-smoke-tests.yaml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ jobs:
4949
fi
5050
skopeo --version
5151
52+
- name: Install Python dependencies
53+
run: pip install pyyaml
54+
5255
- name: Authenticate to GHCR
5356
run: echo "${{ secrets.GITHUB_TOKEN }}" | skopeo login ghcr.io -u "${{ github.actor }}" --password-stdin
5457

@@ -63,6 +66,21 @@ jobs:
6366
echo "=== dynamic-plugins.test.yaml (first 40 lines) ==="
6467
head -40 ./artifacts/dynamic-plugins.test.yaml || true
6568
69+
# TODO: Replace with native TypeScript implementation once available upstream.
70+
- name: Download install-dynamic-plugins.py
71+
run: |
72+
curl -fsSL \
73+
"https://raw.githubusercontent.com/redhat-developer/rhdh/3efb9cc140ff/scripts/install-dynamic-plugins/install-dynamic-plugins.py" \
74+
-o ./artifacts/harness/install-dynamic-plugins.py
75+
76+
- name: Download and extract plugins
77+
working-directory: ./artifacts/harness
78+
run: |
79+
cp ../dynamic-plugins.test.yaml dynamic-plugins.yaml
80+
python3 install-dynamic-plugins.py ./dynamic-plugins-root
81+
env:
82+
SKIP_INTEGRITY_CHECK: "true"
83+
6684
- name: Install smoke test dependencies
6785
working-directory: ./artifacts/harness
6886
run: npm install --ignore-scripts 2>&1 | tail -5
@@ -77,13 +95,17 @@ jobs:
7795
[ -f ../app-config.yaml ] && CONFIG_ARGS="$CONFIG_ARGS --config ../app-config.yaml"
7896
[ -f ../app-config.test.yaml ] && CONFIG_ARGS="$CONFIG_ARGS --config ../app-config.test.yaml"
7997
98+
GENERATED_CFG="./dynamic-plugins-root/app-config.dynamic-plugins.yaml"
99+
[ -f "$GENERATED_CFG" ] && CONFIG_ARGS="$CONFIG_ARGS --config $GENERATED_CFG"
100+
80101
ENV_ARGS=""
81102
[ -f ../test.env ] && ENV_ARGS="--env-file ../test.env"
82103
83-
echo "Running: node smoke-test.mjs --plugins-yaml ../dynamic-plugins.test.yaml $CONFIG_ARGS $ENV_ARGS"
104+
echo "Running: node smoke-test.mjs --plugins-yaml ../dynamic-plugins.test.yaml --skip-download $CONFIG_ARGS $ENV_ARGS"
84105
85106
node smoke-test.mjs \
86107
--plugins-yaml ../dynamic-plugins.test.yaml \
108+
--skip-download \
87109
$CONFIG_ARGS \
88110
$ENV_ARGS \
89111
2>&1 | tee ../smoke-test.log
@@ -136,4 +158,4 @@ jobs:
136158

137159
- name: Cleanup
138160
if: always()
139-
run: rm -rf ./artifacts/harness/dynamic-plugins-root ./artifacts/harness/.tmp-oci || true
161+
run: rm -rf ./artifacts/harness/dynamic-plugins-root || true

smoke-tests/app-config.yaml

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,5 @@
1-
app:
2-
title: Backstage Test App
3-
baseUrl: http://localhost:7007
4-
5-
backend:
6-
baseUrl: http://localhost:7007
7-
listen:
8-
port: 7007
9-
database:
10-
client: better-sqlite3
11-
connection: ":memory:"
12-
csp:
13-
connect-src: ["'self'", "http:", "https:"]
14-
cors:
15-
origin: http://localhost:7007
16-
methods: [GET, POST, PUT, DELETE]
17-
credentials: true
18-
19-
auth:
20-
environment: development
21-
providers:
22-
guest: {}
23-
24-
# Minimal catalog configuration.
25-
catalog:
26-
rules:
27-
- allow: [Component, API, Group, User, Template, Location]
28-
locations: []
29-
30-
# This is required by the frontend app plugin for schema validation.
311
dynamicPlugins:
32-
# This directory is used by the backend to unpack OCI plugins.
332
rootDirectory: ./dynamic-plugins-root
34-
# Disable the default directory scanning for local plugins
353
sources:
364
local: {}
37-
# A dummy frontend config is sufficient for our backend-only test.
385
frontend: {}
39-
40-
# Add minimal analytics key to satisfy app bundle schema validation.
41-
analytics: {}
42-
43-
# Disable the permission plugin for simplified testing.
44-
permission:
45-
enabled: false

smoke-tests/package.json

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,14 @@
1010
"prettier:fix": "prettier --write ."
1111
},
1212
"dependencies": {
13-
"@backstage/backend-app-api": "1.5.0",
14-
"@backstage/backend-defaults": "0.15.2",
1513
"@backstage/backend-dynamic-feature-service": "0.7.9",
1614
"@backstage/backend-plugin-api": "1.7.0",
17-
"@backstage/catalog-client": "1.13.0",
18-
"@backstage/catalog-model": "1.7.6",
15+
"@backstage/backend-test-utils": "1.4.0",
1916
"@backstage/cli-node": "0.2.18",
2017
"@backstage/config": "1.3.6",
2118
"@backstage/config-loader": "1.10.8",
2219
"@backstage/errors": "1.2.7",
23-
"@backstage/plugin-auth-backend": "0.27.0",
24-
"@backstage/plugin-auth-backend-module-guest-provider": "0.2.16",
25-
"@backstage/plugin-auth-node": "0.6.13",
26-
"@backstage/plugin-catalog-backend": "3.4.0",
27-
"@backstage/plugin-catalog-backend-module-logs": "0.1.19",
28-
"@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "0.2.17",
29-
"@backstage/plugin-catalog-node": "2.0.0",
30-
"@backstage/plugin-events-backend": "0.5.11",
31-
"@backstage/plugin-events-node": "0.4.19",
32-
"@backstage/plugin-permission-backend": "0.7.9",
33-
"@backstage/plugin-permission-backend-module-allow-all-policy": "0.2.17",
34-
"@backstage/plugin-permission-common": "0.9.6",
35-
"@backstage/plugin-permission-node": "0.7.9",
36-
"@backstage/plugin-proxy-backend": "0.6.10",
37-
"@backstage/plugin-scaffolder-backend": "3.1.3",
38-
"@backstage/plugin-scaffolder-node": "0.6.3",
39-
"@backstage/plugin-search-backend": "2.0.12",
40-
"@backstage/plugin-search-backend-module-catalog": "0.3.12",
4120
"@backstage/types": "1.2.2",
42-
"better-sqlite3": "12.8.0",
4321
"js-yaml": "4.1.0"
4422
},
4523
"devDependencies": {

0 commit comments

Comments
 (0)