Skip to content

Commit

Permalink
browser groups
Browse files Browse the repository at this point in the history
  • Loading branch information
shamilovtim committed Dec 3, 2023
1 parent 81d7e46 commit 4731442
Show file tree
Hide file tree
Showing 10 changed files with 246 additions and 11 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/tests-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

test-with-browsers:
name: test-with-browsers (group ${{ matrix.group }})
name: test-with-browsers (${{ matrix.browser }})
# Run browser tests using macOS so that WebKit tests don't fail under a Linux environment
runs-on: macos-latest
strategy:
# parallelism strategy: agent takes as long as roughly all other pkgs combined.
matrix:
include:
- group: "A"
packages: "--workspace packages/agent --workspace packages/dids "
- group: "B"
packages: "--workspace packages/common --workspace packages/crypto --workspace packages/credentials --workspace packages/user-agent --workspace packages/proxy-agent --workspace packages/api --workspace packages/identity-agent"
browser: ['--group chromium', ' --group firefox', '--group webkit']
# include:
# - group: "A"
# packages: "--workspace packages/agent"
# - group: "B"
# packages: "--workspace packages/common --workspace packages/crypto --workspace packages/dids --workspace packages/credentials --workspace packages/user-agent --workspace packages/proxy-agent --workspace packages/api --workspace packages/identity-agent"
steps:
- name: Checkout source
uses: actions/checkout@v4
Expand Down Expand Up @@ -139,16 +139,16 @@ jobs:
- name: Build esm
run: npm run build:esm --ws

- name: Build browser for matrix ${{ matrix.group }}
run: npm run build:browser ${{ matrix.packages }}
- name: Build browser bundles
run: npm run build:browser --ws

- name: Run dwn-server (background)
run: |
node node_modules/@web5/dwn-server/dist/esm/src/main.js &
echo "DWN_SERVER_BACKGROUND_PROCESS=$!" >> $GITHUB_ENV
- name: Run tests for matrix ${{ matrix.group }}
run: npm run test:browser ${{ matrix.packages }}
- name: Run tests for matrix ${{ matrix.browser }}
run: npm run test:browser --ws -- ${{ matrix.browser }}

- name: Terminate dwn-server
run: kill $DWN_SERVER_BACKGROUND_PROCESS || true
Expand Down
27 changes: 27 additions & 0 deletions packages/agent/web-test-runner.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,31 @@ module.exports = {
timeout: '30000',
},
},
groups: [
{
name : 'chromium',
browsers : [
playwrightLauncher({
product: 'chromium',
}),
],
},
{
name : 'firefox',
browsers : [
playwrightLauncher({
product: 'firefox',
}),
],
},
{
name : 'webkit',
browsers : [
playwrightLauncher({
product: 'webkit',
}),
],
},
],
};

26 changes: 26 additions & 0 deletions packages/api/web-test-runner.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,30 @@ module.exports = {
timeout: '15000',
},
},
groups: [
{
name : 'chromium',
browsers : [
playwrightLauncher({
product: 'chromium',
}),
],
},
{
name : 'firefox',
browsers : [
playwrightLauncher({
product: 'firefox',
}),
],
},
{
name : 'webkit',
browsers : [
playwrightLauncher({
product: 'webkit',
}),
],
},
],
};
26 changes: 26 additions & 0 deletions packages/common/web-test-runner.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,30 @@ module.exports = {
timeout: '15000',
},
},
groups: [
{
name : 'chromium',
browsers : [
playwrightLauncher({
product: 'chromium',
}),
],
},
{
name : 'firefox',
browsers : [
playwrightLauncher({
product: 'firefox',
}),
],
},
{
name : 'webkit',
browsers : [
playwrightLauncher({
product: 'webkit',
}),
],
},
],
};
26 changes: 26 additions & 0 deletions packages/credentials/web-test-runner.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,30 @@ module.exports = {
timeout: '15000',
},
},
groups: [
{
name : 'chromium',
browsers : [
playwrightLauncher({
product: 'chromium',
}),
],
},
{
name : 'firefox',
browsers : [
playwrightLauncher({
product: 'firefox',
}),
],
},
{
name : 'webkit',
browsers : [
playwrightLauncher({
product: 'webkit',
}),
],
},
],
};
26 changes: 26 additions & 0 deletions packages/crypto/web-test-runner.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,30 @@ module.exports = {
timeout: '15000',
},
},
groups: [
{
name : 'chromium',
browsers : [
playwrightLauncher({
product: 'chromium',
}),
],
},
{
name : 'firefox',
browsers : [
playwrightLauncher({
product: 'firefox',
}),
],
},
{
name : 'webkit',
browsers : [
playwrightLauncher({
product: 'webkit',
}),
],
},
],
};
26 changes: 26 additions & 0 deletions packages/dids/web-test-runner.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,30 @@ module.exports = {
timeout: '15000',
},
},
groups: [
{
name : 'chromium',
browsers : [
playwrightLauncher({
product: 'chromium',
}),
],
},
{
name : 'firefox',
browsers : [
playwrightLauncher({
product: 'firefox',
}),
],
},
{
name : 'webkit',
browsers : [
playwrightLauncher({
product: 'webkit',
}),
],
},
],
};
26 changes: 26 additions & 0 deletions packages/identity-agent/web-test-runner.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,30 @@ module.exports = {
timeout: '15000',
},
},
groups: [
{
name : 'chromium',
browsers : [
playwrightLauncher({
product: 'chromium',
}),
],
},
{
name : 'firefox',
browsers : [
playwrightLauncher({
product: 'firefox',
}),
],
},
{
name : 'webkit',
browsers : [
playwrightLauncher({
product: 'webkit',
}),
],
},
],
};
26 changes: 26 additions & 0 deletions packages/proxy-agent/web-test-runner.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,30 @@ module.exports = {
timeout: '15000',
},
},
groups: [
{
name : 'chromium',
browsers : [
playwrightLauncher({
product: 'chromium',
}),
],
},
{
name : 'firefox',
browsers : [
playwrightLauncher({
product: 'firefox',
}),
],
},
{
name : 'webkit',
browsers : [
playwrightLauncher({
product: 'webkit',
}),
],
},
],
};
26 changes: 26 additions & 0 deletions packages/user-agent/web-test-runner.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,30 @@ module.exports = {
timeout: '15000',
},
},
groups: [
{
name : 'chromium',
browsers : [
playwrightLauncher({
product: 'chromium',
}),
],
},
{
name : 'firefox',
browsers : [
playwrightLauncher({
product: 'firefox',
}),
],
},
{
name : 'webkit',
browsers : [
playwrightLauncher({
product: 'webkit',
}),
],
},
],
};

0 comments on commit 4731442

Please sign in to comment.