Skip to content

Commit

Permalink
Revert "test: rm readPublished helper"
Browse files Browse the repository at this point in the history
This reverts commit 7c9e695.
  • Loading branch information
turadg committed Nov 7, 2024
1 parent 7c9e695 commit 3ea8635
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
13 changes: 8 additions & 5 deletions a3p-integration/proposals/z:acceptance/core-eval.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { retryUntilCondition } from '@agoric/client-utils';

import { walletUtils } from './test-lib/index.js';

const { readLatest } = walletUtils.vstorage;

const SUBMISSION_DIR = 'core-eval-test-submission';

/**
Expand All @@ -24,11 +22,16 @@ const replaceTemplateValuesInFile = async (fileName, replacements) => {
await writeFile(`${fileName}.js`, script);
};

/** @param {string} path } */
const readPublished = async path => {
return walletUtils.vstorage.readLatest(`published.${path}`);
};

test(`core eval works`, async t => {
const nodePath = 'published.foo.bar';
const nodePath = 'foo.bar';
const nodeValue = 'baz';

await t.throwsAsync(readLatest(nodePath), {
await t.throwsAsync(readPublished(nodePath), {
message: /not found/,
});

Expand All @@ -40,7 +43,7 @@ test(`core eval works`, async t => {
await evalBundles(SUBMISSION_DIR);

const actualValue = await retryUntilCondition(
async () => readLatest(nodePath),
async () => readPublished(nodePath),
value => value === nodeValue,
'core eval not processed yet',
{ setTimeout, retryIntervalMs: 5000, maxRetries: 15 },
Expand Down
9 changes: 6 additions & 3 deletions a3p-integration/proposals/z:acceptance/localchain.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@ import { walletUtils } from './test-lib/index.js';

const SUBMISSION_DIR = 'localchaintest-submission';

const { readLatest } = walletUtils.vstorage;
/** @param {string} path } */
const readPublished = async path => {
return walletUtils.vstorage.readLatest(`published.${path}`);
};

// The testing assertions are in the submission that runs in the core-eval.
// The test here runs that and confirms the eval made it through all the assertions.
test(`localchain passes tests`, async t => {
await evalBundles(SUBMISSION_DIR);

const nodePath = 'published.test.localchain';
const nodePath = 'test.localchain';
const nodeValue = JSON.stringify({ success: true });

const actualValue = await retryUntilCondition(
() => readLatest(nodePath),
async () => readPublished(nodePath),
value => value === nodeValue,
'core eval not processed yet',
{ setTimeout, retryIntervalMs: 5000, maxRetries: 15 },
Expand Down

0 comments on commit 3ea8635

Please sign in to comment.