From 9b0478d4254f35db8406bcd9ecd04bf6b49ce3d8 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 6 Jul 2022 11:28:51 +0200 Subject: [PATCH] Add SIMAPP46_ENABLED/SLOW_SIMAPP46_ENABLED env variabled and add to CI --- .circleci/config.yml | 4 +++- packages/faucet/src/faucet.spec.ts | 4 ++-- packages/ledger-amino/src/testutils.spec.ts | 4 ++-- .../stargate/src/modules/authz/queries.spec.ts | 4 ++-- packages/stargate/src/modules/gov/messages.spec.ts | 6 +++--- packages/stargate/src/testutils.spec.ts | 14 +++++++++----- packages/stargate/webpack.web.config.js | 2 ++ 7 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f87633b980..5fd6a76cf4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,7 +28,7 @@ workflows: - build matrix: parameters: - simapp: ["simapp42", "simapp44"] + simapp: ["simapp42", "simapp44", "simapp46"] - test-node: requires: - build @@ -159,6 +159,7 @@ jobs: command: | [ "<< parameters.simapp >>" = "simapp42" ] && export SIMAPP42_ENABLED=1 SLOW_SIMAPP42_ENABLED=1 [ "<< parameters.simapp >>" = "simapp44" ] && export SIMAPP44_ENABLED=1 SLOW_SIMAPP44_ENABLED=1 + [ "<< parameters.simapp >>" = "simapp46" ] && export SIMAPP46_ENABLED=1 SLOW_SIMAPP46_ENABLED=1 yarn test --stream - run: name: Run CLI selftest @@ -178,6 +179,7 @@ jobs: command: | [ "<< parameters.simapp >>" = "simapp42" ] && export SIMAPP42_ENABLED=1 SLOW_SIMAPP42_ENABLED=1 [ "<< parameters.simapp >>" = "simapp44" ] && export SIMAPP44_ENABLED=1 SLOW_SIMAPP44_ENABLED=1 + [ "<< parameters.simapp >>" = "simapp46" ] && export SIMAPP46_ENABLED=1 SLOW_SIMAPP46_ENABLED=1 ./run_examples.sh - run: name: Stop chains diff --git a/packages/faucet/src/faucet.spec.ts b/packages/faucet/src/faucet.spec.ts index b97e91cd9e..5d2748aee9 100644 --- a/packages/faucet/src/faucet.spec.ts +++ b/packages/faucet/src/faucet.spec.ts @@ -7,8 +7,8 @@ import { Faucet } from "./faucet"; import { TokenConfiguration } from "./tokenmanager"; function pendingWithoutSimapp(): void { - if (!process.env.SIMAPP42_ENABLED && !process.env.SIMAPP44_ENABLED) { - return pending("Set SIMAPP42_ENABLED or SIMAPP44_ENABLED to enabled Stargate node-based tests"); + if (!process.env.SIMAPP42_ENABLED && !process.env.SIMAPP44_ENABLED && !process.env.SIMAPP46_ENABLED) { + return pending("Set SIMAPP{42,44,46}_ENABLED to enabled Stargate node-based tests"); } } diff --git a/packages/ledger-amino/src/testutils.spec.ts b/packages/ledger-amino/src/testutils.spec.ts index 49dfd157a7..5a689c1410 100644 --- a/packages/ledger-amino/src/testutils.spec.ts +++ b/packages/ledger-amino/src/testutils.spec.ts @@ -19,12 +19,12 @@ export function pendingWithoutLedger(): void { } export function simappEnabled(): boolean { - return !!process.env.SIMAPP42_ENABLED || !!process.env.SIMAPP44_ENABLED; + return !!process.env.SIMAPP42_ENABLED || !!process.env.SIMAPP44_ENABLED || !!process.env.SIMAPP46_ENABLED; } export function pendingWithoutSimapp(): void { if (!simappEnabled()) { - return pending("Set SIMAPP42_ENABLED or SIMAPP44_ENABLED to enable Simapp-based tests"); + return pending("Set SIMAPP{42,44,46}_ENABLED to enable Simapp-based tests"); } } diff --git a/packages/stargate/src/modules/authz/queries.spec.ts b/packages/stargate/src/modules/authz/queries.spec.ts index 2cf3316bbe..f79e2e59be 100644 --- a/packages/stargate/src/modules/authz/queries.spec.ts +++ b/packages/stargate/src/modules/authz/queries.spec.ts @@ -11,7 +11,7 @@ import { defaultSigningClientOptions, faucet, makeRandomAddress, - pendingWithoutSimapp44, + pendingWithoutSimapp44Or46, simapp, simapp44Enabled, } from "../../testutils.spec"; @@ -79,7 +79,7 @@ describe("AuthzExtension", () => { describe("grants", () => { it("works", async () => { - pendingWithoutSimapp44(); + pendingWithoutSimapp44Or46(); const [client, tmClient] = await makeClientWithAuthz(simapp.tendermintUrl); const response = await client.authz.grants(granter1Address, grantee1Address, ""); expect(response.grants.length).toEqual(1); diff --git a/packages/stargate/src/modules/gov/messages.spec.ts b/packages/stargate/src/modules/gov/messages.spec.ts index 6724ca6a9c..3361468f23 100644 --- a/packages/stargate/src/modules/gov/messages.spec.ts +++ b/packages/stargate/src/modules/gov/messages.spec.ts @@ -12,7 +12,7 @@ import { faucet, nonNegativeIntegerMatcher, pendingWithoutSimapp, - pendingWithoutSimapp44, + pendingWithoutSimapp44Or46, simapp, simappEnabled, validator, @@ -171,7 +171,7 @@ describe("gov messages", () => { describe("MsgVoteWeighted", () => { it("works", async () => { - pendingWithoutSimapp44(); // MsgVoteWeighted does not yet exist in Cosmos SDK 0.42 + pendingWithoutSimapp44Or46(); // MsgVoteWeighted does not yet exist in Cosmos SDK 0.42 assert(voterWallet); assert(proposalId, "Missing proposal ID"); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, voterWallet); @@ -204,7 +204,7 @@ describe("gov messages", () => { }); it("works with Amino JSON sign mode", async () => { - pendingWithoutSimapp44(); // MsgVoteWeighted does not yet exist in Cosmos SDK 0.42 + pendingWithoutSimapp44Or46(); // MsgVoteWeighted does not yet exist in Cosmos SDK 0.42 assert(voterWalletAmino); assert(proposalId, "Missing proposal ID"); const client = await SigningStargateClient.connectWithSigner(simapp.tendermintUrl, voterWalletAmino); diff --git a/packages/stargate/src/testutils.spec.ts b/packages/stargate/src/testutils.spec.ts index 3b528a306b..ea7699ed1a 100644 --- a/packages/stargate/src/testutils.spec.ts +++ b/packages/stargate/src/testutils.spec.ts @@ -23,13 +23,17 @@ export function simapp44Enabled(): boolean { return !!process.env.SIMAPP44_ENABLED; } -export function simappEnabled(): boolean { - return simapp42Enabled() || simapp44Enabled(); +export function simapp46Enabled(): boolean { + return !!process.env.SIMAPP46_ENABLED; } -export function pendingWithoutSimapp44(): void { - if (!simapp44Enabled()) { - return pending("Set SIMAPP44_ENABLED to enable Simapp based tests"); +export function simappEnabled(): boolean { + return simapp42Enabled() || simapp44Enabled() || simapp46Enabled(); +} + +export function pendingWithoutSimapp44Or46(): void { + if (!simapp44Enabled() && !simapp46Enabled()) { + return pending("Set SIMAPP{44,46}_ENABLED to enable Simapp based tests"); } } diff --git a/packages/stargate/webpack.web.config.js b/packages/stargate/webpack.web.config.js index b2ed7ef721..6791d45388 100644 --- a/packages/stargate/webpack.web.config.js +++ b/packages/stargate/webpack.web.config.js @@ -21,6 +21,8 @@ module.exports = [ SLOW_SIMAPP42_ENABLED: "", SIMAPP44_ENABLED: "", SLOW_SIMAPP44_ENABLED: "", + SIMAPP46_ENABLED: "", + SLOW_SIMAPP46_ENABLED: "", }), new webpack.ProvidePlugin({ Buffer: ["buffer", "Buffer"],