Skip to content

Commit

Permalink
got simple integration tests set up with pic
Browse files Browse the repository at this point in the history
  • Loading branch information
ByronBecker committed Jul 9, 2024
1 parent ea98df9 commit cbad5d0
Show file tree
Hide file tree
Showing 18 changed files with 11,498 additions and 1,914 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/mops-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,11 @@ jobs:
- name: make sure moc is installed
run: mops toolchain bin moc || mops toolchain use moc latest

- name: run tests
run: npm run test
- name: install dependencies
run: npm run install-deps

- name: run unit tests
run: npm run unit-tests

- name: run integration tests
run: npm run integration-tests
27 changes: 27 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: mops test

on:
push:
branches:
- main
pull_request:

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: ZenVoich/setup-mops@v1

- name: make sure moc is installed
run: mops toolchain bin moc || mops toolchain use moc latest

- name: install dependencies
run: npm run install-deps

- name: run unit tests
run: npm run unit-tests

- name: run integration tests
run: npm run integration-tests
5 changes: 0 additions & 5 deletions integration-test/.dfx/local/canister_ids.json

This file was deleted.

3 changes: 0 additions & 3 deletions integration-test/.dfx/local/network-id

This file was deleted.

3 changes: 3 additions & 0 deletions integration-test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.mops
node_modules
.dfx
5 changes: 2 additions & 3 deletions integration-test/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
},
"app": {
"main": "src/app/main.mo",
"type": "motoko",
"dependencies": ["mock-icrc2-canister"]
"type": "motoko"
}
},
"dfx": "0.20.0",
"defaults": {
"build": {
"packtool": "mops sources"
"packtool": "npx mops sources"
}
}
}
5 changes: 4 additions & 1 deletion integration-test/global-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ declare module 'vitest' {
*/

export async function setup({ provide }: GlobalSetupContext): Promise<void> {
pic = await PocketIcServer.start();
pic = await PocketIcServer.start({
showCanisterLogs: true,
//showRuntimeLogs: true,
});
const url = pic.getUrl();

provide('PIC_URL', url);
Expand Down
2 changes: 2 additions & 0 deletions integration-test/mops.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[dependencies]
base = "0.11.1"
Loading

0 comments on commit cbad5d0

Please sign in to comment.