Skip to content

Commit

Permalink
test(mn2-start): skip if $MN2_PROPOSAL_INFO is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Oct 4, 2023
1 parent fed6bf2 commit b3b1e88
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
/**
* @file mainnet-2 contract start test
*
* Requires several environment variables:
* Expects several environment variables:
* If $MN2_PROPOSAL_INFO is not set, no tests are run.
*
* $MN2_PROPOSAL_INFO is a directory with the results of
* running `agoric run xyz-script.js` one or more times.
Expand Down Expand Up @@ -49,7 +50,16 @@ import { dbTool } from './tools/vat-status.js';

/** @typedef {Awaited<ReturnType<typeof makeTestContext>>} TestContext */
/** @type {import('ava').TestFn<TestContext>}} */
const test = anyTest;
let test = anyTest;

// If $MN2_PROPOSAL_INFO is not set, no tests are run.
if (!('MN2_PROPOSAL_INFO' in processAmbient.env)) {
console.log('MN2_PROPOSAL_INFO not set. Skipping all tests.');
const noop = (..._args) => {};
// @ts-expect-error
test = noop;
Object.assign(test, { before: noop, serial: noop });
}

/**
* Reify file read access as an object.
Expand Down

0 comments on commit b3b1e88

Please sign in to comment.