-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,383 @@ | ||
diff --git a/.eslintignore b/.eslintignore | ||
new file mode 100644 | ||
index 0000000..e5b1994 | ||
--- /dev/null | ||
+++ b/.eslintignore | ||
@@ -0,0 +1 @@ | ||
+playwright.config.ts | ||
diff --git a/.gitignore b/.gitignore | ||
index d452ac2..fbf8139 100644 | ||
--- a/.gitignore | ||
+++ b/.gitignore | ||
@@ -51 +51,4 @@ site | ||
*.session.sql | ||
+ | ||
+# E2E test reports | ||
+e2e-test-report/ | ||
diff --git a/app-config.yaml b/app-config.yaml | ||
index 194549f..08d2abf 100644 | ||
--- a/app-config.yaml | ||
+++ b/app-config.yaml | ||
@@ -48,5 +48,6 @@ proxy: | ||
### A typical reason to do this is to handle HTTPS and CORS for internal services. | ||
- # '/test': | ||
- # target: 'https://example.com' | ||
- # changeOrigin: true | ||
+ # endpoints: | ||
+ # '/test': | ||
+ # target: 'https://example.com' | ||
+ # changeOrigin: true | ||
|
||
diff --git a/backstage.json b/backstage.json | ||
index 2ec3b5f..707af29 100644 | ||
--- a/backstage.json | ||
+++ b/backstage.json | ||
@@ -1,3 +1,3 @@ | ||
{ | ||
- "version": "1.16.0-next.1" | ||
+ "version": "1.20.0-next.1" | ||
} | ||
diff --git a/lerna.json b/lerna.json | ||
index 322929d..529a62f 100644 | ||
--- a/lerna.json | ||
+++ b/lerna.json | ||
@@ -3,4 +3,4 @@ | ||
"npmClient": "yarn", | ||
- "useWorkspaces": true, | ||
- "version": "0.1.0" | ||
+ "version": "0.1.0", | ||
+ "$schema": "node_modules/lerna/schemas/lerna-schema.json" | ||
} | ||
diff --git a/package.json b/package.json | ||
index 0c495ac..2364da8 100644 | ||
--- a/package.json | ||
+++ b/package.json | ||
@@ -5,3 +5,3 @@ | ||
"engines": { | ||
- "node": "16 || 18" | ||
+ "node": "18 || 20" | ||
}, | ||
@@ -19,2 +19,4 @@ | ||
"test:all": "backstage-cli repo test --coverage", | ||
+ "test:e2e": "playwright test", | ||
+ "fix": "backstage-cli repo fix", | ||
"lint": "backstage-cli repo lint --since origin/master", | ||
@@ -31,9 +33,11 @@ | ||
"devDependencies": { | ||
- "@backstage/cli": "^0.22.9-next.0", | ||
+ "@backstage/cli": "^0.24.0-next.1", | ||
+ "@backstage/e2e-test-utils": "^0.1.0", | ||
+ "@playwright/test": "^1.32.3", | ||
"@spotify/prettier-config": "^12.0.0", | ||
- "concurrently": "^6.0.0", | ||
- "lerna": "^4.0.0", | ||
+ "concurrently": "^8.0.0", | ||
+ "lerna": "^7.3.0", | ||
"node-gyp": "^9.0.0", | ||
"prettier": "^2.3.2", | ||
- "typescript": "~5.0.0" | ||
+ "typescript": "~5.2.0" | ||
}, | ||
diff --git a/packages/app/cypress.json b/packages/app/cypress.json | ||
deleted file mode 100644 | ||
index 0cb845a..0000000 | ||
--- a/packages/app/cypress.json | ||
+++ /dev/null | ||
@@ -1,6 +0,0 @@ | ||
-{ | ||
- "baseUrl": "http://localhost:3001", | ||
- "fixturesFolder": false, | ||
- "pluginsFile": false, | ||
- "retries": 3 | ||
-} | ||
diff --git a/packages/app/cypress/.eslintrc.json b/packages/app/cypress/.eslintrc.json | ||
deleted file mode 100644 | ||
index b903ff2..0000000 | ||
--- a/packages/app/cypress/.eslintrc.json | ||
+++ /dev/null | ||
@@ -1,12 +0,0 @@ | ||
-{ | ||
- "plugins": ["cypress"], | ||
- "extends": ["plugin:cypress/recommended"], | ||
- "rules": { | ||
- "jest/expect-expect": [ | ||
- "error", | ||
- { | ||
- "assertFunctionNames": ["expect", "cy.contains", "cy.**.should"] | ||
- } | ||
- ] | ||
- } | ||
-} | ||
diff --git a/packages/app/cypress/integration/app.js b/packages/app/cypress/integration/app.js | ||
deleted file mode 100644 | ||
index 43fb2e3..0000000 | ||
--- a/packages/app/cypress/integration/app.js | ||
+++ /dev/null | ||
@@ -1,6 +0,0 @@ | ||
-describe('App', () => { | ||
- it('should render the catalog', () => { | ||
- cy.visit('/'); | ||
- cy.contains('My Company Catalog'); | ||
- }); | ||
-}); | ||
diff --git a/packages/app/e2e-tests/app.test.ts b/packages/app/e2e-tests/app.test.ts | ||
new file mode 100644 | ||
index 0000000..d45bc0d | ||
--- /dev/null | ||
+++ b/packages/app/e2e-tests/app.test.ts | ||
@@ -0,0 +1,23 @@ | ||
+/* | ||
+ * Copyright 2020 The Backstage Authors | ||
+ * | ||
+ * Licensed under the Apache License, Version 2.0 (the "License"); | ||
+ * you may not use this file except in compliance with the License. | ||
+ * You may obtain a copy of the License at | ||
+ * | ||
+ * http://www.apache.org/licenses/LICENSE-2.0 | ||
+ * | ||
+ * Unless required by applicable law or agreed to in writing, software | ||
+ * distributed under the License is distributed on an "AS IS" BASIS, | ||
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
+ * See the License for the specific language governing permissions and | ||
+ * limitations under the License. | ||
+ */ | ||
+ | ||
+import { test, expect } from '@playwright/test'; | ||
+ | ||
+test('App should render the welcome page', async ({ page }) => { | ||
+ await page.goto('/'); | ||
+ | ||
+ await expect(page.getByText('My Company Catalog')).toBeVisible(); | ||
+}); | ||
diff --git a/packages/app/package.json b/packages/app/package.json | ||
index e63bebb..2100405 100644 | ||
--- a/packages/app/package.json | ||
+++ b/packages/app/package.json | ||
@@ -13,34 +13,30 @@ | ||
"test": "backstage-cli package test", | ||
- "lint": "backstage-cli package lint", | ||
- "test:e2e": "cross-env PORT=3001 start-server-and-test start http://localhost:3001 cy:dev", | ||
- "test:e2e:ci": "cross-env PORT=3001 start-server-and-test start http://localhost:3001 cy:run", | ||
- "cy:dev": "cypress open", | ||
- "cy:run": "cypress run --browser chrome" | ||
+ "lint": "backstage-cli package lint" | ||
}, | ||
"dependencies": { | ||
- "@backstage/app-defaults": "^1.4.1-next.1", | ||
- "@backstage/catalog-model": "^1.4.1-next.0", | ||
- "@backstage/cli": "^0.22.9-next.0", | ||
- "@backstage/core-app-api": "^1.8.2-next.0", | ||
- "@backstage/core-components": "^0.13.3-next.1", | ||
- "@backstage/core-plugin-api": "^1.5.3-next.0", | ||
- "@backstage/integration-react": "^1.1.15-next.1", | ||
- "@backstage/plugin-api-docs": "^0.9.6-next.1", | ||
- "@backstage/plugin-catalog": "^1.11.3-next.1", | ||
- "@backstage/plugin-catalog-common": "^1.0.15-next.0", | ||
- "@backstage/plugin-catalog-graph": "^0.2.32-next.1", | ||
- "@backstage/plugin-catalog-import": "^0.9.10-next.1", | ||
- "@backstage/plugin-catalog-react": "^1.7.1-next.1", | ||
- "@backstage/plugin-github-actions": "^0.6.1-next.1", | ||
- "@backstage/plugin-org": "^0.6.10-next.1", | ||
- "@backstage/plugin-permission-react": "^0.4.14-next.1", | ||
- "@backstage/plugin-scaffolder": "^1.14.1-next.1", | ||
- "@backstage/plugin-search": "^1.3.3-next.1", | ||
- "@backstage/plugin-search-react": "^1.6.3-next.1", | ||
- "@backstage/plugin-tech-radar": "^0.6.6-next.1", | ||
- "@backstage/plugin-techdocs": "^1.6.5-next.1", | ||
- "@backstage/plugin-techdocs-module-addons-contrib": "^1.0.15-next.1", | ||
- "@backstage/plugin-techdocs-react": "^1.1.8-next.1", | ||
- "@backstage/plugin-user-settings": "^0.7.5-next.1", | ||
- "@backstage/theme": "^0.4.1-next.0", | ||
+ "@backstage/app-defaults": "^1.4.5-next.1", | ||
+ "@backstage/catalog-model": "^1.4.3", | ||
+ "@backstage/cli": "^0.24.0-next.1", | ||
+ "@backstage/core-app-api": "^1.11.1-next.0", | ||
+ "@backstage/core-components": "^0.13.8-next.1", | ||
+ "@backstage/core-plugin-api": "^1.8.0-next.0", | ||
+ "@backstage/integration-react": "^1.1.21-next.1", | ||
+ "@backstage/plugin-api-docs": "^0.9.13-next.1", | ||
+ "@backstage/plugin-catalog": "^1.15.0-next.1", | ||
+ "@backstage/plugin-catalog-common": "^1.0.17", | ||
+ "@backstage/plugin-catalog-graph": "^0.2.38-next.1", | ||
+ "@backstage/plugin-catalog-import": "^0.10.2-next.1", | ||
+ "@backstage/plugin-catalog-react": "^1.9.0-next.1", | ||
+ "@backstage/plugin-github-actions": "^0.6.7-next.1", | ||
+ "@backstage/plugin-org": "^0.6.16-next.1", | ||
+ "@backstage/plugin-permission-react": "^0.4.17-next.0", | ||
+ "@backstage/plugin-scaffolder": "^1.16.0-next.1", | ||
+ "@backstage/plugin-search": "^1.4.2-next.1", | ||
+ "@backstage/plugin-search-react": "^1.7.2-next.1", | ||
+ "@backstage/plugin-tech-radar": "^0.6.10-next.1", | ||
+ "@backstage/plugin-techdocs": "^1.8.1-next.1", | ||
+ "@backstage/plugin-techdocs-module-addons-contrib": "^1.1.2-next.1", | ||
+ "@backstage/plugin-techdocs-react": "^1.1.13-next.1", | ||
+ "@backstage/plugin-user-settings": "^0.7.12-next.1", | ||
+ "@backstage/theme": "^0.4.4-next.0", | ||
"@material-ui/core": "^4.12.2", | ||
@@ -55,3 +51,4 @@ | ||
"devDependencies": { | ||
- "@backstage/test-utils": "^1.4.1-next.1", | ||
+ "@backstage/test-utils": "^1.4.5-next.0", | ||
+ "@playwright/test": "^1.32.3", | ||
"@testing-library/jest-dom": "^5.10.1", | ||
@@ -60,8 +57,4 @@ | ||
"@testing-library/dom": "^8.0.0", | ||
- "@types/node": "^16.11.26", | ||
"@types/react-dom": "*", | ||
- "cross-env": "^7.0.0", | ||
- "cypress": "^9.7.0", | ||
- "eslint-plugin-cypress": "^2.10.3", | ||
- "start-server-and-test": "^1.10.11" | ||
+ "cross-env": "^7.0.0" | ||
}, | ||
diff --git a/packages/app/public/index.html b/packages/app/public/index.html | ||
index c6083b3..fc758ee 100644 | ||
--- a/packages/app/public/index.html | ||
+++ b/packages/app/public/index.html | ||
@@ -10,3 +10,2 @@ | ||
/> | ||
- <link rel="apple-touch-icon" href="<%= publicPath %>/logo192.png" /> | ||
<!-- | ||
diff --git a/packages/backend/Dockerfile b/packages/backend/Dockerfile | ||
index 51f7124..18548e9 100644 | ||
--- a/packages/backend/Dockerfile | ||
+++ b/packages/backend/Dockerfile | ||
@@ -11,3 +11,10 @@ | ||
|
||
-FROM node:16-bullseye-slim | ||
+FROM node:18-bookworm-slim | ||
+ | ||
+# Install isolate-vm dependencies, these are needed by the @backstage/plugin-scaffolder-backend. | ||
+RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ | ||
+ --mount=type=cache,target=/var/lib/apt,sharing=locked \ | ||
+ apt-get update && \ | ||
+ apt-get install -y --no-install-recommends python3 g++ build-essential && \ | ||
+ yarn config set python /usr/bin/python3 | ||
|
||
@@ -18,4 +25,3 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ | ||
apt-get update && \ | ||
- apt-get install -y --no-install-recommends libsqlite3-dev python3 build-essential && \ | ||
- yarn config set python /usr/bin/python3 | ||
+ apt-get install -y --no-install-recommends libsqlite3-dev | ||
|
||
diff --git a/packages/backend/package.json b/packages/backend/package.json | ||
index 49474dd..f224eaf 100644 | ||
--- a/packages/backend/package.json | ||
+++ b/packages/backend/package.json | ||
@@ -18,19 +18,19 @@ | ||
"dependencies": { | ||
- "@backstage/backend-common": "^0.19.1-next.0", | ||
- "@backstage/backend-tasks": "^0.5.4-next.0", | ||
- "@backstage/catalog-client": "^1.4.3-next.0", | ||
- "@backstage/catalog-model": "^1.4.1-next.0", | ||
- "@backstage/config": "^1.0.8", | ||
- "@backstage/plugin-app-backend": "^0.3.47-next.0", | ||
- "@backstage/plugin-auth-backend": "^0.18.5-next.1", | ||
- "@backstage/plugin-auth-node": "^0.2.16-next.0", | ||
- "@backstage/plugin-catalog-backend": "^1.11.0-next.0", | ||
- "@backstage/plugin-permission-common": "^0.7.7-next.0", | ||
- "@backstage/plugin-permission-node": "^0.7.10-next.0", | ||
- "@backstage/plugin-proxy-backend": "^0.2.41-next.0", | ||
- "@backstage/plugin-scaffolder-backend": "^1.15.1-next.0", | ||
- "@backstage/plugin-search-backend": "^1.3.3-next.0", | ||
- "@backstage/plugin-search-backend-module-pg": "^0.5.8-next.0", | ||
- "@backstage/plugin-search-backend-node": "^1.2.3-next.0", | ||
- "@backstage/plugin-techdocs-backend": "^1.6.4-next.0", | ||
+ "@backstage/backend-common": "^0.19.9-next.1", | ||
+ "@backstage/backend-tasks": "^0.5.12-next.1", | ||
+ "@backstage/catalog-client": "^1.4.5", | ||
+ "@backstage/catalog-model": "^1.4.3", | ||
+ "@backstage/config": "^1.1.1", | ||
+ "@backstage/plugin-app-backend": "^0.3.55-next.1", | ||
+ "@backstage/plugin-auth-backend": "^0.20.0-next.1", | ||
+ "@backstage/plugin-auth-node": "^0.4.1-next.1", | ||
+ "@backstage/plugin-catalog-backend": "^1.15.0-next.1", | ||
+ "@backstage/plugin-permission-common": "^0.7.9", | ||
+ "@backstage/plugin-permission-node": "^0.7.18-next.1", | ||
+ "@backstage/plugin-proxy-backend": "^0.4.5-next.1", | ||
+ "@backstage/plugin-scaffolder-backend": "^1.19.0-next.1", | ||
+ "@backstage/plugin-search-backend": "^1.4.7-next.1", | ||
+ "@backstage/plugin-search-backend-module-pg": "^0.5.16-next.1", | ||
+ "@backstage/plugin-search-backend-node": "^1.2.11-next.1", | ||
+ "@backstage/plugin-techdocs-backend": "^1.9.0-next.1", | ||
"app": "link:../app", | ||
@@ -44,3 +44,3 @@ | ||
"devDependencies": { | ||
- "@backstage/cli": "^0.22.9-next.0", | ||
+ "@backstage/cli": "^0.24.0-next.1", | ||
"@types/dockerode": "^3.3.0", | ||
diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts | ||
index 1c08288..04c4ff9 100644 | ||
--- a/packages/backend/src/index.ts | ||
+++ b/packages/backend/src/index.ts | ||
@@ -41,3 +41,3 @@ function makeCreateEnv(config: Config) { | ||
const tokenManager = ServerTokenManager.noop(); | ||
- const taskScheduler = TaskScheduler.fromConfig(config); | ||
+ const taskScheduler = TaskScheduler.fromConfig(config, { databaseManager }); | ||
|
||
diff --git a/playwright.config.ts b/playwright.config.ts | ||
new file mode 100644 | ||
index 0000000..37c7fb1 | ||
--- /dev/null | ||
+++ b/playwright.config.ts | ||
@@ -0,0 +1,60 @@ | ||
+/* | ||
+ * Copyright 2023 The Backstage Authors | ||
+ * | ||
+ * Licensed under the Apache License, Version 2.0 (the "License"); | ||
+ * you may not use this file except in compliance with the License. | ||
+ * You may obtain a copy of the License at | ||
+ * | ||
+ * http://www.apache.org/licenses/LICENSE-2.0 | ||
+ * | ||
+ * Unless required by applicable law or agreed to in writing, software | ||
+ * distributed under the License is distributed on an "AS IS" BASIS, | ||
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
+ * See the License for the specific language governing permissions and | ||
+ * limitations under the License. | ||
+ */ | ||
+ | ||
+import { defineConfig } from '@playwright/test'; | ||
+import { generateProjects } from '@backstage/e2e-test-utils/playwright'; | ||
+ | ||
+/** | ||
+ * See https://playwright.dev/docs/test-configuration. | ||
+ */ | ||
+export default defineConfig({ | ||
+ timeout: 60_000, | ||
+ | ||
+ expect: { | ||
+ timeout: 5_000, | ||
+ }, | ||
+ | ||
+ // Run your local dev server before starting the tests | ||
+ webServer: process.env.CI | ||
+ ? [] | ||
+ : [ | ||
+ { | ||
+ command: 'yarn start', | ||
+ port: 3000, | ||
+ reuseExistingServer: true, | ||
+ timeout: 60_000, | ||
+ }, | ||
+ ], | ||
+ | ||
+ forbidOnly: !!process.env.CI, | ||
+ | ||
+ retries: process.env.CI ? 2 : 0, | ||
+ | ||
+ reporter: [['html', { open: 'never', outputFolder: 'e2e-test-report' }]], | ||
+ | ||
+ use: { | ||
+ actionTimeout: 0, | ||
+ baseURL: | ||
+ process.env.PLAYWRIGHT_URL ?? | ||
+ (process.env.CI ? 'http://localhost:7007' : 'http://localhost:3000'), | ||
+ screenshot: 'only-on-failure', | ||
+ trace: 'on-first-retry', | ||
+ }, | ||
+ | ||
+ outputDir: 'node_modules/.cache/e2e-test-results', | ||
+ | ||
+ projects: generateProjects(), // Find all packages with e2e-test folders | ||
+}); |