Skip to content

Commit

Permalink
test(orchestration): skip non-invitation-based boot tests (#9573)
Browse files Browse the repository at this point in the history
refs: #9449

## Description

Disables `@agoric/orchestration` tests in `packages/boot` that interact directly with Vows. _`EV` does not currently support vows, and these tests block efforts related to #9449._

For tests that are skipped and not deleted, I propose testing these paths after the completion of #9572. 

### Testing Considerations

Skips tests instead deleting them. Taking on some tech debt until #9572
  • Loading branch information
mergify[bot] authored Jun 25, 2024
2 parents d941b39 + 5ba21bc commit ba6eb45
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 77 deletions.
51 changes: 5 additions & 46 deletions packages/boot/test/bootstrapTests/orchestration.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js';

import { Fail } from '@agoric/assert';
import { AmountMath } from '@agoric/ertp';
import { documentStorageSchema } from '@agoric/internal/src/storage-test-utils.js';
import type { CosmosValidatorAddress } from '@agoric/orchestration';
import type { start as startStakeIca } from '@agoric/orchestration/src/examples/stakeIca.contract.js';
import type { Instance } from '@agoric/zoe/src/zoeService/utils.js';
import { M, matches } from '@endo/patterns';
import type { TestFn } from 'ava';
import {
makeWalletFactoryContext,
Expand Down Expand Up @@ -73,7 +71,7 @@ test.serial('config', async t => {
}
});

test.serial('stakeOsmo - queries', async t => {
test.skip('stakeOsmo - queries', async t => {
const {
buildProposal,
evalProposal,
Expand Down Expand Up @@ -109,53 +107,14 @@ test.serial('stakeOsmo - queries', async t => {
);
});

test.serial('stakeAtom - repl-style', async t => {
const {
buildProposal,
evalProposal,
runUtils: { EV },
} = t.context;
test.serial('stakeAtom - smart wallet', async t => {
const { buildProposal, evalProposal, agoricNamesRemotes, readLatest } =
t.context;

await evalProposal(
buildProposal('@agoric/builders/scripts/orchestration/init-stakeAtom.js'),
);

const agoricNames = await EV.vat('bootstrap').consumeItem('agoricNames');
const instance: Instance<typeof startStakeIca> = await EV(agoricNames).lookup(
'instance',
'stakeAtom',
);
t.truthy(instance, 'stakeAtom instance is available');

const zoe: ZoeService = await EV.vat('bootstrap').consumeItem('zoe');
const publicFacet = await EV(zoe).getPublicFacet(instance);
t.truthy(publicFacet, 'stakeAtom publicFacet is available');

const account = await EV(publicFacet).makeAccount();
t.log('account', account);
t.truthy(account, 'makeAccount returns an account on ATOM connection');
t.truthy(
matches(account, M.remotable('ChainAccount')),
'account is a remotable',
);

const atomBrand: Brand = await EV(agoricNames).lookup('brand', 'ATOM');
const atomAmount = AmountMath.make(atomBrand, 10n);

const validatorAddress: CosmosValidatorAddress = {
address: 'cosmosvaloper1test',
chainId: 'gaiatest',
addressEncoding: 'bech32',
};
await t.notThrowsAsync(EV(account).delegate(validatorAddress, atomAmount));

await t.throwsAsync(EV(account).getBalance('uatom'), {
message: 'Queries not available for chain "cosmoshub-4"',
});
});

test.serial('stakeAtom - smart wallet', async t => {
const { agoricNamesRemotes, readLatest } = t.context;

const wd = await t.context.walletFactoryDriver.provideSmartWallet(
'agoric1testStakAtom',
);
Expand Down
40 changes: 9 additions & 31 deletions packages/boot/test/bootstrapTests/vat-orchestration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ test.before(async t => {

test.after.always(t => t.context.shutdown?.());

test('makeAccount returns an ICA connection', async t => {
// skipping until EV supports Vows, or this functionality is tested elsewhere #9572
test.skip('makeAccount returns an ICA connection', async t => {
const {
runUtils: { EV },
} = t.context;
Expand Down Expand Up @@ -105,7 +106,8 @@ test('makeAccount returns an ICA connection', async t => {
});
});

test('ICA connection can be closed', async t => {
// skipping until EV supports Vows, or this functionality is tested elsewhere #9572
test.skip('ICA connection can be closed', async t => {
const {
runUtils: { EV },
} = t.context;
Expand All @@ -127,7 +129,7 @@ test('ICA connection can be closed', async t => {
});
});

test('ICA connection can send msg with proto3', async t => {
test.skip('ICA connection can send msg with proto3', async t => {
const {
runUtils: { EV },
} = t.context;
Expand Down Expand Up @@ -186,7 +188,8 @@ test('ICA connection can send msg with proto3', async t => {
});
});

test('Query connection can be created', async t => {
// skipping until EV supports Vows, or this functionality is tested elsewhere #9572
test.skip('Query connection can be created', async t => {
const {
runUtils: { EV },
} = t.context;
Expand All @@ -211,7 +214,8 @@ test('Query connection can be created', async t => {
}
});

test('Query connection can send a query', async t => {
// skipping until EV supports Vows, or this functionality is tested elsewhere #9572
test.skip('Query connection can send a query', async t => {
const {
runUtils: { EV },
} = t.context;
Expand Down Expand Up @@ -263,29 +267,3 @@ test('Query connection can send a query', async t => {
await contract({ orchestration });
}
});

test('provideICQConnection is idempotent', async t => {
const {
runUtils: { EV },
} = t.context;
const orchestration: OrchestrationService =
await EV.vat('bootstrap').consumeItem('orchestration');

const queryConn0 =
await EV(orchestration).provideICQConnection('connection-0');
const queryConn1 =
await EV(orchestration).provideICQConnection('connection-1');
const queryConn02 =
await EV(orchestration).provideICQConnection('connection-0');

const [addr0, addr1, addr02] = await Promise.all([
EV(queryConn0).getRemoteAddress(),
EV(queryConn1).getRemoteAddress(),
EV(queryConn02).getRemoteAddress(),
]);
t.is(addr0, addr02);
t.not(addr0, addr1);

const [result] = await EV(queryConn02).query([balanceQuery]);
t.is(result.code, 0, 'ICQConnectionKit from MapStore state can send queries');
});

0 comments on commit ba6eb45

Please sign in to comment.