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

fix-issue-364: fix turbo run test faled somtimes #365

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test("migration works", async (t) => {
"hello"
);

contract.deploy("./build/status-message-migrate-add-field.wasm");
await contract.deploy("./build/status-message-migrate-add-field.wasm");
await ali.call(contract, "migrateState", {});

t.is(
Expand Down
2 changes: 1 addition & 1 deletion examples/__tests__/test-state-migration.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ test("migration works", async (t) => {
const res1 = await contract.view("countMessages", {});
t.is(res1, 4);

contract.deploy("./build/state-migration-new.wasm");
await contract.deploy("./build/state-migration-new.wasm");

await ali.call(contract, "migrateState", {});

Expand Down
4 changes: 3 additions & 1 deletion tests/__tests__/bytes.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ test.beforeEach(async (t) => {
const root = worker.rootAccount;

// Deploy the test contract.
const bytesContract = await root.devDeploy("build/bytes.wasm");
const bytesContract = await root.createSubAccount("bytes-contract");
await bytesContract.deploy("build/bytes.wasm");

// Test users
const ali = await root.createSubAccount("ali");
const bob = await root.createSubAccount("bob");
Expand Down
6 changes: 2 additions & 4 deletions tests/__tests__/function-params.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ test.before(async (t) => {
// Prepare sandbox for tests, create accounts, deploy contracts, etx.
const root = worker.rootAccount;

// Deploy the test contract.
const functionParamsContract = await root.devDeploy(
"build/function-params.wasm"
);
const functionParamsContract = await root.createSubAccount("function-params-contract");
await functionParamsContract.deploy("build/function-params.wasm");

// Test users
const ali = await root.createSubAccount("ali");
Expand Down
3 changes: 2 additions & 1 deletion tests/__tests__/lookup-map.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ test.beforeEach(async (t) => {
const root = worker.rootAccount;

// Deploy the test contract.
const lookupMapContract = await root.devDeploy("build/lookup-map.wasm");
const lookupMapContract = await root.createSubAccount("lookup-map-contract");
await lookupMapContract.deploy("build/lookup-map.wasm");

// Test users
const ali = await root.createSubAccount("ali");
Expand Down
3 changes: 2 additions & 1 deletion tests/__tests__/lookup-set.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ test.beforeEach(async (t) => {
const root = worker.rootAccount;

// Deploy the test contract.
const lookupSetContract = await root.devDeploy("build/lookup-set.wasm");
const lookupSetContract = await root.createSubAccount("lookup-set-contract");
await lookupSetContract.deploy("build/lookup-set.wasm");
// Test users
const ali = await root.createSubAccount("ali");
const bob = await root.createSubAccount("bob");
Expand Down
3 changes: 2 additions & 1 deletion tests/__tests__/test-date-serialization.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ test.beforeEach(async (t) => {
const root = worker.rootAccount;

// Create and deploy test contract
const dsContract = await root.devDeploy("build/date-serialization.wasm");
const dsContract = await root.createSubAccount("ds-contract");
await dsContract.deploy("build/date-serialization.wasm");

// Save state for test runs
t.context.worker = worker;
Expand Down
3 changes: 2 additions & 1 deletion tests/__tests__/test-middlewares.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ test.beforeEach(async (t) => {
const root = worker.rootAccount;

// Deploy the contract.
const middlewares = await root.devDeploy("build/middlewares.wasm");
const middlewares = await root.createSubAccount("middlewares-contract");
await middlewares.deploy("build/middlewares.wasm");

// Create the init args.
const args = JSON.stringify({ randomData: "anything" });
Expand Down
3 changes: 2 additions & 1 deletion tests/__tests__/unordered-map.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ test.beforeEach(async (t) => {
const root = worker.rootAccount;

// Deploy the test contract.
const unorderedMapContract = await root.devDeploy("build/unordered-map.wasm");
const unorderedMapContract = await root.createSubAccount("unordered-map-contract");
await unorderedMapContract.deploy("build/unordered-map.wasm");
// Test users
const ali = await root.createSubAccount("ali");
const bob = await root.createSubAccount("bob");
Expand Down
3 changes: 2 additions & 1 deletion tests/__tests__/unordered-set.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ test.beforeEach(async (t) => {
const root = worker.rootAccount;

// Deploy the test contract.
const unorderedSetContract = await root.devDeploy("build/unordered-set.wasm");
const unorderedSetContract = await root.createSubAccount("unordered-set-contract");
await unorderedSetContract.deploy("build/unordered-set.wasm");

// Test users
const ali = await root.createSubAccount("ali");
Expand Down
Loading