Skip to content
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

Add required env variables for e2e telemetry tests to README #8341

Merged
merged 16 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ CHROME_EXTENSION_ID=mpjjildhmpddojocokjkgmlkkkfjnepo
# Shadow DOM mode for all components. Default is SHADOW_DOM=closed in regular webpack builds, open elsewhere
# SHADOW_DOM=open

# Enable telemetry in development. Default is false
# DEV_EVENT_TELEMETRY=true

# This makes all optional permissions required in the manifest.json to avoid permission popups. Only required for Playwright tests.
# REQUIRE_OPTIONAL_PERMISSIONS_IN_MANIFEST=1

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ env:
SERVICE_URL: https://app-stg.pixiebrix.com/
E2E_TEST_USER_EMAIL_UNAFFILIATED: ${{ secrets.E2E_TEST_USER_EMAIL_UNAFFILIATED }}
E2E_TEST_USER_PASSWORD_UNAFFILIATED: ${{ secrets.E2E_TEST_USER_PASSWORD_UNAFFILIATED }}
DEV_EVENT_TELEMETRY: false
mnholtz marked this conversation as resolved.
Show resolved Hide resolved
DATADOG_CLIENT_TOKEN: ${{ secrets.DATADOG_CLIENT_TOKEN }}

jobs:
test:
Expand Down Expand Up @@ -81,7 +83,6 @@ jobs:
CHROME_EXTENSION_ID: kkomancachnjkdalpcokenmjlimmbaog
CHROME_MANIFEST_KEY: ${{ secrets.CHROME_MANIFEST_STAGING_PUBLIC_KEY }}
DATADOG_APPLICATION_ID: ${{ secrets.DATADOG_APPLICATION_ID }}
DATADOG_CLIENT_TOKEN: ${{ secrets.DATADOG_CLIENT_TOKEN }}
- name: Save extension
uses: actions/upload-artifact@v4
if: ${{ fromJSON(env.PUBLIC_RELEASE)}}
Expand Down Expand Up @@ -203,7 +204,6 @@ jobs:
MV: ${{ matrix.MV }}
CHROME_MANIFEST_KEY: ${{ matrix.CHROME_MANIFEST_KEY }}
DATADOG_APPLICATION_ID: ${{ secrets.DATADOG_APPLICATION_ID }}
DATADOG_CLIENT_TOKEN: ${{ secrets.DATADOG_CLIENT_TOKEN }}
REQUIRE_OPTIONAL_PERMISSIONS_IN_MANIFEST: 1
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 3 additions & 1 deletion end-to-end-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ One-time setup:
- The test user password `E2E_TEST_USER_PASSWORD_UNAFFILIATED`
- Uncomment `REQUIRE_OPTIONAL_PERMISSIONS_IN_MANIFEST=1`
- Uncomment `SHADOW_DOM=open`
- Uncomment `DATADOG_CLIENT_TOKEN` (used for telemetry tests, can be set to a fake token, e.g. `secret123`)
mnholtz marked this conversation as resolved.
Show resolved Hide resolved
- Uncomment `DEV_EVENT_TELEMETRY` (used for telemetry tests, actual telemetry requests should be mocked during testing)
- `MV` will determine the manifest version for the both the extension and the tests (defaulted to 3 if not defined.)
- Install browsers: Execute `npx playwright install chromium chrome msedge`.

1. Install dependencies: Run `npm install`
2. Build the extension: Run: `npm run build:webpack` (or `npm run watch`)
2. Build the extension: Run: `npm run watch`
3. Run the tests: Use the command `npm run test:e2e`.

- To run tests in interactive UI mode, use `npm run test:e2e -- --ui`. This view shows you the entire test suite and
Expand Down
2 changes: 2 additions & 0 deletions end-to-end-tests/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const requiredEnvVariables = [
"SERVICE_URL",
"E2E_TEST_USER_EMAIL_UNAFFILIATED",
"E2E_TEST_USER_PASSWORD_UNAFFILIATED",
"DEV_EVENT_TELEMETRY",
"DATADOG_CLIENT_TOKEN",
mnholtz marked this conversation as resolved.
Show resolved Hide resolved
] as const;

// It's not strictly required for the test run itself, but the extension manifest.json must have been built with
Expand Down
Loading