Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

test: run tests on webkit #177

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 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
39 changes: 23 additions & 16 deletions .github/workflows/js-test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ on:
pull_request:

jobs:

check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present lint
- run: npm run --if-present dep-check
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present lint
- run: npm run --if-present dep-check

test-node:
needs: check
Expand Down Expand Up @@ -98,21 +97,18 @@ jobs:

test-webkit:
needs: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
node: [lts/*]
fail-fast: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npx playwright install-deps
- run: npm run --if-present test:webkit
- uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
directory: ./.nyc_output
flags: webkit

test-webkit-webworker:
Expand Down Expand Up @@ -163,7 +159,18 @@ jobs:
flags: electron-renderer

release:
needs: [test-node, test-chrome, test-chrome-webworker, test-firefox, test-firefox-webworker, test-webkit, test-webkit-webworker, test-electron-main, test-electron-renderer]
needs:
[
test-node,
test-chrome,
test-chrome-webworker,
test-firefox,
test-firefox-webworker,
test-webkit,
test-webkit-webworker,
test-electron-main,
test-electron-renderer,
]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
Expand Down
29 changes: 15 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
"build": "aegir build",
"test": "aegir test -t browser",
"test:chrome": "aegir test -t browser --cov",
"test:webkit": "aegir test -t browser -- --browser webkit",
"test:firefox": "aegir test -t browser -- --browser firefox",
"lint": "aegir lint",
"lint:fix": "aegir lint --fix",
Expand All @@ -135,18 +136,18 @@
"release": "aegir release"
},
"dependencies": {
"@chainsafe/libp2p-noise": "^12.0.0",
"@libp2p/interface-connection": "^5.0.2",
"@chainsafe/libp2p-noise": "^12.0.1",
"@libp2p/interface-connection": "^5.1.0",
"@libp2p/interface-metrics": "^4.0.8",
"@libp2p/interface-peer-id": "^2.0.2",
"@libp2p/interface-registrar": "^2.0.12",
"@libp2p/interface-stream-muxer": "^4.1.2",
"@libp2p/interface-transport": "^4.0.3",
"@libp2p/interfaces": "^3.3.2",
"@libp2p/logger": "^2.0.7",
"@libp2p/logger": "^2.1.1",
"@libp2p/peer-id": "^2.0.3",
"@multiformats/mafmt": "^12.1.2",
"@multiformats/multiaddr": "^12.1.2",
"@multiformats/mafmt": "^12.1.5",
"@multiformats/multiaddr": "^12.1.3",
"abortable-iterator": "^5.0.1",
"detect-browser": "^5.3.0",
"it-length-prefixed": "^9.0.1",
Expand All @@ -160,24 +161,24 @@
"p-event": "^5.0.1",
"protons-runtime": "^5.0.0",
"uint8arraylist": "^2.4.3",
"uint8arrays": "^4.0.3"
"uint8arrays": "^4.0.4"
},
"devDependencies": {
"@chainsafe/libp2p-yamux": "^4.0.1",
"@libp2p/interface-libp2p": "^3.1.0",
"@chainsafe/libp2p-yamux": "^4.0.2",
"@libp2p/interface-libp2p": "^3.2.0",
"@libp2p/interface-mocks": "^12.0.1",
"@libp2p/peer-id-factory": "^2.0.3",
"@libp2p/websockets": "^6.0.1",
"@types/sinon": "^10.0.14",
"aegir": "^39.0.7",
"delay": "^5.0.0",
"@libp2p/websockets": "^6.0.3",
"@types/sinon": "^10.0.15",
"aegir": "^39.0.9",
"delay": "^6.0.0",
"it-all": "^3.0.2",
"it-length": "^3.0.2",
"it-map": "^3.0.3",
"it-pair": "^2.0.6",
"libp2p": "^0.45.0",
"libp2p": "^0.45.5",
"protons": "^7.0.2",
"sinon": "^15.0.4",
"sinon": "^15.1.0",
"sinon-ts": "^1.0.0"
}
}
17 changes: 9 additions & 8 deletions test/basics.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,16 @@ describe('basics', () => {
remoteNode = await createNode()
})

afterEach(async () => {
if (localNode != null) {
await localNode.stop()
}
// This is currently causing issues on macOS runs
maschad marked this conversation as resolved.
Show resolved Hide resolved
// afterEach(async () => {
// if (localNode != null) {
// await localNode.stop()
// }

if (remoteNode != null) {
await remoteNode.stop()
}
})
// if (remoteNode != null) {
// await remoteNode.stop()
// }
// })

it('can dial through a relay', async () => {
const remoteAddr = remoteNode.getMultiaddrs()
Expand Down