Skip to content

Commit

Permalink
ci: skip certain tests for aux ci runs
Browse files Browse the repository at this point in the history
  • Loading branch information
thepiwo committed Mar 6, 2024
1 parent 0721822 commit e41d0b7
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 39 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ jobs:
node-version: [16, 18, 20, 21]
node-tag: [latest]
compiler-tag: [v7.6.1] # latest is v8.0.0-rc1 which is not supported by the sdk currently
aux-ci-run: [true]

# for lts node also test first known compatible and latest known good compiler and node versions
include:
- node-version: 20
node-tag: v6.8.0 # v6.3.0 to v6.7.0 use a different config format
compiler-tag: v7.4.0
aux-ci-run: true
- node-version: 20
node-tag: v6.12.0
compiler-tag: v7.6.1
node-tag: # latest known good versions are defaulted to, thus not passed explicitly
compiler-tag:
aux-ci-run: # no aux-ci-run as main ci run, latest version run all tests that are version independent

runs-on: ubuntu-latest

Expand All @@ -36,3 +39,4 @@ jobs:
NODE_VERSION: ${{ matrix.node-version }}
NODE_TAG: ${{ matrix.node-tag }}
COMPILER_TAG: ${{ matrix.compiler-tag }}
AUX_CI_RUN: ${{ matrix.aux-ci-run }}
76 changes: 39 additions & 37 deletions tests/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ describe("command line usage", () => {
assert.isTrue(await isEnvRunning(cwd));

// don't run for all gh-action matrix tests
if (
process.env.NODE_TAG === "latest" &&
process.env.COMPILER_TAG === "latest" &&
process.env.NODE_VERSION === "18"
) {
if (!process.env.AUX_CI_RUN) {
const resSecond = await exec(
"aeproject env --nodeVersion v6.10.0 --compilerVersion v7.4.0",
{ cwd },
Expand All @@ -70,7 +66,8 @@ describe("command line usage", () => {

const resThird = await exec("aeproject env", { cwd });
assert.include(resThird.stdout, "updating");
} else print("skipping env version and update tests");
} else
print("skipping env version and update tests for auxiliary test run");
});

it("env --restart", async () => {
Expand All @@ -93,38 +90,43 @@ describe("command line usage", () => {
});

it("init --update --next", async () => {
const res = await exec("aeproject init --update --next -y", { cwd });
assert.equal(res.code, 0);
assert.equal(res.stderr, "");
assert.include(
res.stdout,
"===== updating project file and directory structure =====",
);
assert.include(
res.stdout,
"===== updating project file and directory structure for next version =====",
);

assert.include(file(path.join(cwd, "docker/aeternity.yaml")), "hard_forks");
assert.include(
file(path.join(cwd, "test/exampleTest.js")),
"ignoreVersion: true",
);
assert.include(
file(path.join(cwd, "docker-compose.yml")),
"COMPILER_TAG:-latest",
);
assert.include(
file(path.join(cwd, "docker-compose.yml")),
"NODE_TAG:-latest",
);

const resEnv = await exec("aeproject env", { cwd });
assert.equal(resEnv.code, 0);
assert.isTrue(await isEnvRunning(cwd));
if (!process.env.AUX_CI_RUN) {
const res = await exec("aeproject init --update --next -y", { cwd });
assert.equal(res.code, 0);
assert.equal(res.stderr, "");
assert.include(
res.stdout,
"===== updating project file and directory structure =====",
);
assert.include(
res.stdout,
"===== updating project file and directory structure for next version =====",
);

assert.include(
file(path.join(cwd, "docker/aeternity.yaml")),
"hard_forks",
);
assert.include(
file(path.join(cwd, "test/exampleTest.js")),
"ignoreVersion: true",
);
assert.include(
file(path.join(cwd, "docker-compose.yml")),
"COMPILER_TAG:-latest",
);
assert.include(
file(path.join(cwd, "docker-compose.yml")),
"NODE_TAG:-latest",
);

const resEnv = await exec("aeproject env", { cwd });
assert.equal(resEnv.code, 0);
assert.isTrue(await isEnvRunning(cwd));

assert.include(resEnv.stdout, "aeternity/aeternity latest-bundle");
assert.include(resEnv.stdout, "aeternity/aesophia_http latest");
assert.include(resEnv.stdout, "aeternity/aeternity latest-bundle");
assert.include(resEnv.stdout, "aeternity/aesophia_http latest");
} else console.log("skipping next test for auxiliary test run");
});

it("env --stop", async () => {
Expand Down

0 comments on commit e41d0b7

Please sign in to comment.