-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
test(e2e): Add astro-7-static E2E app
#24075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
dev-packages/e2e-tests/test-applications/astro-7-static/.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # build output | ||
| dist/ | ||
|
|
||
| # generated types | ||
| .astro/ | ||
|
|
||
| # dependencies | ||
| node_modules/ | ||
|
|
||
| # logs | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| pnpm-debug.log* | ||
|
|
||
| # environment variables | ||
| .env | ||
| .env.production | ||
|
|
||
| # macOS-specific files | ||
| .DS_Store | ||
|
|
||
| # jetbrains setting folder | ||
| .idea/ | ||
|
|
||
| test-results |
24 changes: 24 additions & 0 deletions
24
dev-packages/e2e-tests/test-applications/astro-7-static/astro.config.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import sentry from '@sentry/astro'; | ||
| // @ts-check | ||
| import { defineConfig } from 'astro/config'; | ||
|
|
||
| import node from '@astrojs/node'; | ||
|
|
||
| // https://astro.build/config | ||
| export default defineConfig({ | ||
| integrations: [ | ||
| sentry({ | ||
| debug: true, | ||
| sourcemaps: { | ||
| disable: true, | ||
| }, | ||
| }), | ||
| ], | ||
| output: 'server', | ||
| security: { | ||
| allowedDomains: [{ hostname: 'localhost' }], | ||
| }, | ||
| adapter: node({ | ||
| mode: 'standalone', | ||
| }), | ||
| }); |
31 changes: 31 additions & 0 deletions
31
dev-packages/e2e-tests/test-applications/astro-7-static/docker-compose.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| services: | ||
| db: | ||
| image: mysql:8.0 | ||
| restart: always | ||
| container_name: e2e-tests-astro-7-static-mysql | ||
| # The `mysql` 2.x driver doesn't speak MySQL 8's default | ||
| # `caching_sha2_password` auth, so force the legacy plugin. | ||
| command: ['--default-authentication-plugin=mysql_native_password'] | ||
| ports: | ||
| - '3306:3306' | ||
| environment: | ||
| MYSQL_ROOT_PASSWORD: docker | ||
| healthcheck: | ||
| test: ['CMD-SHELL', 'mysqladmin ping -h 127.0.0.1 -uroot -pdocker'] | ||
| interval: 2s | ||
| timeout: 3s | ||
| retries: 30 | ||
| start_period: 10s | ||
|
|
||
| redis: | ||
| image: redis:7 | ||
| restart: always | ||
| container_name: e2e-tests-astro-7-static-redis | ||
| ports: | ||
| - '6379:6379' | ||
| healthcheck: | ||
| test: ['CMD', 'redis-cli', 'ping'] | ||
| interval: 2s | ||
| timeout: 3s | ||
| retries: 30 | ||
| start_period: 5s | ||
14 changes: 14 additions & 0 deletions
14
dev-packages/e2e-tests/test-applications/astro-7-static/global-setup.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { execSync } from 'child_process'; | ||
| import { dirname } from 'path'; | ||
| import { fileURLToPath } from 'url'; | ||
|
|
||
| const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
|
|
||
| export default async function globalSetup() { | ||
| // Start MySQL + Redis via Docker Compose. `--wait` blocks until the | ||
| // healthchecks in docker-compose.yml pass, so the app can connect immediately. | ||
| execSync('docker compose up -d --wait', { | ||
| cwd: __dirname, | ||
| stdio: 'inherit', | ||
| }); | ||
| } |
12 changes: 12 additions & 0 deletions
12
dev-packages/e2e-tests/test-applications/astro-7-static/global-teardown.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { execSync } from 'child_process'; | ||
| import { dirname } from 'path'; | ||
| import { fileURLToPath } from 'url'; | ||
|
|
||
| const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
|
|
||
| export default async function globalTeardown() { | ||
| execSync('docker compose down --volumes', { | ||
| cwd: __dirname, | ||
| stdio: 'inherit', | ||
| }); | ||
| } |
33 changes: 33 additions & 0 deletions
33
dev-packages/e2e-tests/test-applications/astro-7-static/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| { | ||
| "name": "astro-7-static", | ||
| "type": "module", | ||
| "version": "0.0.1", | ||
| "scripts": { | ||
| "dev": "astro dev", | ||
| "build": "astro build", | ||
| "preview": "astro preview", | ||
| "astro": "astro", | ||
| "start": "node ./dist/server/entry.mjs", | ||
| "test:build": "pnpm install && pnpm build", | ||
| "test:assert": "pnpm test:prod && pnpm test:dev", | ||
| "test:prod": "TEST_ENV=production playwright test", | ||
| "test:dev": "TEST_ENV=development playwright test db" | ||
| }, | ||
| "//": "Need to use ioredis 5.10.1 because that's the last version before they support tracing channels", | ||
| "dependencies": { | ||
| "@astrojs/node": "^11.1.4", | ||
| "@playwright/test": "~1.56.0", | ||
| "@sentry-internal/test-utils": "link:../../../test-utils", | ||
| "@sentry/astro": "file:../../packed/sentry-astro-packed.tgz", | ||
| "astro": "^7.2.4", | ||
| "ioredis": "5.10.1", | ||
| "mysql": "^2.18.1" | ||
| }, | ||
| "volta": { | ||
| "node": "22.22.0", | ||
| "extends": "../../package.json" | ||
| }, | ||
| "sentryTest": { | ||
| "optional": true | ||
| } | ||
| } |
18 changes: 18 additions & 0 deletions
18
dev-packages/e2e-tests/test-applications/astro-7-static/playwright.config.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { getPlaywrightConfig } from '@sentry-internal/test-utils'; | ||
|
|
||
| const testEnv = process.env.TEST_ENV; | ||
|
|
||
| if (!testEnv) { | ||
| throw new Error('No test env defined'); | ||
| } | ||
|
|
||
| // `astro dev` ignores PORT, so the port goes on the command. | ||
| const config = getPlaywrightConfig({ | ||
| startCommand: testEnv === 'development' ? 'pnpm dev --port 3030' : 'pnpm start', | ||
| }); | ||
|
|
||
| export default { | ||
| ...config, | ||
| globalSetup: './global-setup.mjs', | ||
| globalTeardown: './global-teardown.mjs', | ||
| }; |
9 changes: 9 additions & 0 deletions
9
dev-packages/e2e-tests/test-applications/astro-7-static/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
dev-packages/e2e-tests/test-applications/astro-7-static/sentry.client.config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import * as Sentry from '@sentry/astro'; | ||
|
|
||
| Sentry.init({ | ||
| traceLifecycle: 'static', | ||
| dsn: import.meta.env.PUBLIC_E2E_TEST_DSN, | ||
| environment: 'qa', | ||
| tracesSampleRate: 1.0, | ||
| tunnel: 'http://localhost:3031/', // proxy server | ||
| integrations: [ | ||
| Sentry.browserTracingIntegration({ | ||
| beforeStartSpan: opts => { | ||
| if (opts.name.startsWith('/blog/')) { | ||
| return { | ||
| ...opts, | ||
| name: window.location.pathname, | ||
| }; | ||
| } | ||
| return opts; | ||
| }, | ||
| }), | ||
| ], | ||
| debug: true, | ||
| }); |
10 changes: 10 additions & 0 deletions
10
dev-packages/e2e-tests/test-applications/astro-7-static/sentry.server.config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import * as Sentry from '@sentry/astro'; | ||
|
|
||
| Sentry.init({ | ||
| traceLifecycle: 'static', | ||
| dsn: import.meta.env.PUBLIC_E2E_TEST_DSN, | ||
| environment: 'qa', | ||
| tracesSampleRate: 1.0, | ||
| tunnel: 'http://localhost:3031/', // proxy server | ||
| debug: true, | ||
| }); |
1 change: 1 addition & 0 deletions
1
dev-packages/e2e-tests/test-applications/astro-7-static/src/assets/astro.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
dev-packages/e2e-tests/test-applications/astro-7-static/src/assets/background.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
dev-packages/e2e-tests/test-applications/astro-7-static/src/components/Avatar.astro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
|
|
||
| --- | ||
|
|
||
| <img alt="User avatar" src="/favicon.svg" /> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.