Make env vars simapp42/simapp44 specific

This commit is contained in:
Simon Warta 2021-10-22 00:08:06 +02:00
parent f89d4903b7
commit a2b6e74524
9 changed files with 77 additions and 57 deletions

View File

@ -146,8 +146,8 @@ jobs:
environment:
LAUNCHPAD_ENABLED: 1
ERC20_ENABLED: 1
SIMAPP_ENABLED: 1
SLOW_SIMAPP_ENABLED: 1
SIMAPP42_ENABLED: 1
SLOW_SIMAPP42_ENABLED: 1
TENDERMINT_ENABLED: 1
SOCKETSERVER_ENABLED: 1
SKIP_BUILD: 1
@ -266,8 +266,8 @@ jobs:
environment:
LAUNCHPAD_ENABLED: 1
ERC20_ENABLED: 1
SIMAPP_ENABLED: 1
SLOW_SIMAPP_ENABLED: 1
SIMAPP42_ENABLED: 1
SLOW_SIMAPP42_ENABLED: 1
TENDERMINT_ENABLED: 1
SOCKETSERVER_ENABLED: 1
SKIP_BUILD: 1
@ -382,8 +382,8 @@ jobs:
environment:
LAUNCHPAD_ENABLED: 1
ERC20_ENABLED: 1
SIMAPP_ENABLED: 1
SLOW_SIMAPP_ENABLED: 1
SIMAPP42_ENABLED: 1
SLOW_SIMAPP42_ENABLED: 1
TENDERMINT_ENABLED: 1
SOCKETSERVER_ENABLED: 1
SKIP_BUILD: 1
@ -484,8 +484,8 @@ jobs:
environment:
LAUNCHPAD_ENABLED: 1
ERC20_ENABLED: 1
SIMAPP_ENABLED: 1
SLOW_SIMAPP_ENABLED: 1
SIMAPP42_ENABLED: 1
SLOW_SIMAPP42_ENABLED: 1
TENDERMINT_ENABLED: 1
SOCKETSERVER_ENABLED: 1
SKIP_BUILD: 1

View File

@ -2,7 +2,7 @@
set -o errexit -o nounset -o pipefail
command -v shellcheck >/dev/null && shellcheck "$0"
if [ -n "${SIMAPP_ENABLED:-}" ]; then
if [ -n "${SIMAPP42_ENABLED:-}" ]; then
yarn node ./bin/cosmwasm-cli --init examples/cosmwasm.ts --code "process.exit(0)"
fi
if [ -n "${LAUNCHPAD_ENABLED:-}" ]; then
@ -13,6 +13,6 @@ yarn node ./bin/cosmwasm-cli --init examples/generate_address.ts --code "process
yarn node ./bin/cosmwasm-cli --init examples/local_faucet.ts --code "process.exit(0)"
yarn node ./bin/cosmwasm-cli --init examples/mask.ts --code "process.exit(0)"
yarn node ./bin/cosmwasm-cli --init examples/multisig_address.ts --code "process.exit(0)"
if [ -n "${SIMAPP_ENABLED:-}" ]; then
if [ -n "${SIMAPP42_ENABLED:-}" ]; then
yarn node ./bin/cosmwasm-cli --init examples/stargate.ts --code "process.exit(0)"
fi

View File

@ -14,8 +14,8 @@ function pendingWithoutLaunchpad(): void {
}
function pendingWithoutSimapp(): void {
if (!process.env.SIMAPP_ENABLED) {
return pending("Set SIMAPP_ENABLED to enabled Stargate node-based tests");
if (!process.env.SIMAPP42_ENABLED && !process.env.SIMAPP44_ENABLED) {
return pending("Set SIMAPP42_ENABLED or SIMAPP44_ENABLED to enabled Stargate node-based tests");
}
}

View File

@ -63,7 +63,7 @@ and execute:
```sh
export LEDGER_ENABLED=1
export SIMAPP_ENABLED=1
export SIMAPP42_ENABLED=1
yarn test
```

View File

@ -29,12 +29,12 @@ export function pendingWithoutLaunchpad(): void {
}
export function simappEnabled(): boolean {
return !!process.env.SIMAPP_ENABLED;
return !!process.env.SIMAPP42_ENABLED || !!process.env.SIMAPP44_ENABLED;
}
export function pendingWithoutSimapp(): void {
if (!simappEnabled()) {
return pending("Set SIMAPP_ENABLED to enable Simapp-based tests");
return pending("Set SIMAPP42_ENABLED or SIMAPP44_ENABLED to enable Simapp-based tests");
}
}

View File

@ -1,7 +1,7 @@
import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
import Long from "long";
import { pendingWithoutSimapp, simapp } from "../testutils.spec";
import { pendingWithoutSimapp42, simapp } from "../testutils.spec";
import { IbcExtension, setupIbcExtension } from "./ibc";
import * as ibcTest from "./ibctestdata.spec";
import { QueryClient } from "./queryclient";
@ -15,7 +15,7 @@ describe("IbcExtension", () => {
describe("channel", () => {
describe("channel", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.channel.channel(ibcTest.portId, ibcTest.channelId);
@ -29,7 +29,7 @@ describe("IbcExtension", () => {
describe("channels", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.channel.channels();
@ -43,7 +43,7 @@ describe("IbcExtension", () => {
describe("allChannels", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.channel.allChannels();
@ -55,7 +55,7 @@ describe("IbcExtension", () => {
describe("connectionChannels", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.channel.connectionChannels(ibcTest.connectionId);
@ -69,7 +69,7 @@ describe("IbcExtension", () => {
describe("allConnectionChannels", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.channel.allConnectionChannels(ibcTest.connectionId);
@ -81,7 +81,7 @@ describe("IbcExtension", () => {
describe("clientState", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.channel.clientState(ibcTest.portId, ibcTest.channelId);
@ -99,7 +99,7 @@ describe("IbcExtension", () => {
describe("consensusState", () => {
xit("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.channel.consensusState(
@ -121,7 +121,7 @@ describe("IbcExtension", () => {
describe("packetCommitment", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.channel.packetCommitment(
@ -139,7 +139,7 @@ describe("IbcExtension", () => {
describe("packetCommitments", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.channel.packetCommitments(ibcTest.portId, ibcTest.channelId);
@ -153,7 +153,7 @@ describe("IbcExtension", () => {
describe("allPacketCommitments", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.channel.allPacketCommitments(ibcTest.portId, ibcTest.channelId);
@ -165,7 +165,7 @@ describe("IbcExtension", () => {
describe("packetReceipt", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.channel.packetReceipt(ibcTest.portId, ibcTest.channelId, 1);
@ -178,7 +178,7 @@ describe("IbcExtension", () => {
describe("packetAcknowledgement", () => {
it("works", async () => {
pending("We don't have an acknowledgement for testing at the moment");
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.channel.packetAcknowledgement(
@ -196,7 +196,7 @@ describe("IbcExtension", () => {
describe("packetAcknowledgements", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.channel.packetAcknowledgements(ibcTest.portId, ibcTest.channelId);
@ -210,7 +210,7 @@ describe("IbcExtension", () => {
describe("allPacketAcknowledgements", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.channel.allPacketAcknowledgements(
@ -225,7 +225,7 @@ describe("IbcExtension", () => {
describe("unreceivedPackets", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.channel.unreceivedPackets(
@ -242,7 +242,7 @@ describe("IbcExtension", () => {
describe("unreceivedAcks", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.channel.unreceivedAcks(
@ -259,7 +259,7 @@ describe("IbcExtension", () => {
describe("nextSequenceReceive", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.channel.nextSequenceReceive(ibcTest.portId, ibcTest.channelId);
@ -275,7 +275,7 @@ describe("IbcExtension", () => {
describe("client", () => {
describe("state", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.client.state(ibcTest.clientId);
@ -290,7 +290,7 @@ describe("IbcExtension", () => {
describe("states", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.client.states();
@ -311,7 +311,7 @@ describe("IbcExtension", () => {
describe("allStates", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.client.allStates();
@ -331,7 +331,7 @@ describe("IbcExtension", () => {
describe("consensusState", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.client.consensusState(ibcTest.clientId);
@ -346,7 +346,7 @@ describe("IbcExtension", () => {
describe("consensusStates", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.client.consensusStates(ibcTest.clientId);
@ -368,7 +368,7 @@ describe("IbcExtension", () => {
describe("allConsensusStates", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.client.allConsensusStates(ibcTest.clientId);
@ -390,7 +390,7 @@ describe("IbcExtension", () => {
describe("params", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.client.params();
@ -404,7 +404,7 @@ describe("IbcExtension", () => {
describe("stateTm", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.client.stateTm(ibcTest.clientId);
@ -417,7 +417,7 @@ describe("IbcExtension", () => {
describe("statesTm", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.client.statesTm();
@ -435,7 +435,7 @@ describe("IbcExtension", () => {
describe("allStatesTm", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.client.allStatesTm();
@ -453,7 +453,7 @@ describe("IbcExtension", () => {
describe("consensusStateTm", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.client.consensusStateTm(ibcTest.clientId);
@ -468,7 +468,7 @@ describe("IbcExtension", () => {
describe("connection", () => {
describe("connection", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.connection.connection(ibcTest.connectionId);
@ -482,7 +482,7 @@ describe("IbcExtension", () => {
describe("connections", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.connection.connections();
@ -496,7 +496,7 @@ describe("IbcExtension", () => {
describe("allConnections", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.connection.allConnections();
@ -508,7 +508,7 @@ describe("IbcExtension", () => {
describe("clientConnections", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.connection.clientConnections(ibcTest.clientId);
@ -522,7 +522,7 @@ describe("IbcExtension", () => {
describe("clientState", () => {
it("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.connection.clientState(ibcTest.connectionId);
@ -540,7 +540,7 @@ describe("IbcExtension", () => {
describe("consensusState", () => {
xit("works", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
// TODO: Find valid values

View File

@ -23,6 +23,7 @@ import {
ModifyingDirectSecp256k1HdWallet,
ModifyingSecp256k1HdWallet,
pendingWithoutSimapp,
pendingWithoutSimapp42,
simapp,
validator,
} from "./testutils.spec";
@ -117,7 +118,7 @@ describe("SigningStargateClient", () => {
describe("sendIbcTokens", () => {
it("works with direct signing", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic);
const client = await SigningStargateClient.connectWithSigner(
simapp.tendermintUrl,
@ -166,7 +167,7 @@ describe("SigningStargateClient", () => {
});
it("works with Amino signing", async () => {
pendingWithoutSimapp();
pendingWithoutSimapp42();
const wallet = await Secp256k1HdWallet.fromMnemonic(faucet.mnemonic);
const client = await SigningStargateClient.connectWithSigner(
simapp.tendermintUrl,

View File

@ -15,23 +15,37 @@ import { AuthInfo, SignDoc, TxBody } from "cosmjs-types/cosmos/tx/v1beta1/tx";
import { calculateFee, GasPrice } from "./fee";
import { SigningStargateClientOptions } from "./signingstargateclient";
export function simapp42Enabled(): boolean {
return !!process.env.SIMAPP42_ENABLED;
}
export function simapp44Enabled(): boolean {
return !!process.env.SIMAPP44_ENABLED;
}
export function simappEnabled(): boolean {
return !!process.env.SIMAPP_ENABLED;
return simapp42Enabled() || simapp44Enabled();
}
export function pendingWithoutSimapp42(): void {
if (!simapp42Enabled()) {
return pending("Set SIMAPP44_ENABLED to enable Simapp based tests");
}
}
export function pendingWithoutSimapp(): void {
if (!simappEnabled()) {
return pending("Set SIMAPP_ENABLED to enable Simapp based tests");
return pending("Set SIMAPP42_ENABLED or SIMAPP44_ENABLED to enable Simapp based tests");
}
}
export function slowSimappEnabled(): boolean {
return !!process.env.SLOW_SIMAPP_ENABLED;
return !!process.env.SLOW_SIMAPP42_ENABLED || !!process.env.SLOW_SIMAPP44_ENABLED;
}
export function pendingWithoutSlowSimapp(): void {
if (!slowSimappEnabled()) {
return pending("Set SLOW_SIMAPP_ENABLED to enable slow Simapp based tests");
return pending("Set SLOW_SIMAPP42_ENABLED or SLOW_SIMAPP44_ENABLED to enable slow Simapp based tests");
}
}

View File

@ -16,7 +16,12 @@ module.exports = [
filename: "tests.js",
},
plugins: [
new webpack.EnvironmentPlugin({ SIMAPP_ENABLED: "", SLOW_SIMAPP_ENABLED: "" }),
new webpack.EnvironmentPlugin({
SIMAPP42_ENABLED: "",
SLOW_SIMAPP42_ENABLED: "",
SIMAPP44_ENABLED: "",
SLOW_SIMAPP44_ENABLED: "",
}),
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
}),