Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 14 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,17 @@ jobs:
go-version: 1.19
- uses: actions/checkout@v3
- run: go test -v -race -timeout=1h ./...
nodejs:
name: nodejs
runs-on: ubuntu-22.04-16c-64g-600gb
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/checkout@v3
- run: go install $(pwd)/cmd/dagger/
- run: yarn install
- run: yarn run test-sdk
10 changes: 8 additions & 2 deletions TESTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
Run all tests (with some parallelism):
Run all go tests (with some parallelism):

```console
go test -parallel 4 -v -count=1 ./...
```

Run one test
Run one go test:

```console
go test -v -count=1 -run TestExtensionMount $(pwd)/core/integration/
```

NOTE: when running core integration tests don't specify an individual file; always run with the full core/integration/ package or you will get errors (due to use of an init func in suite_test.go).

Run nodejs test(s):

```console
yarn run test-sdk
```
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"node-fetch": "^3.2.10"
},
"scripts": {
"build": "tsc"
"build": "tsc",
"test-sdk": "timeout 60 node sdk/nodejs/test/index.mjs"
},
"devDependencies": {
"@types/node": "^18.7.18",
Expand Down
24 changes: 24 additions & 0 deletions sdk/nodejs/test/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { gql, Engine } from "@dagger.io/dagger";

const engine = new Engine();

engine.run(async (client) => {
// Just run a query to make sure it doesn't fail
await client
.request(
gql`
{
host {
workdir {
read {
id
}
}
}
}
`
)
.then((result) => result.host.workdir.read.id);
console.log("Success!");
});