Skip to content

Commit

Permalink
Merge branch 'main' of github.com-tb:Moonsong-Labs/moonwall into chor…
Browse files Browse the repository at this point in the history
…e/update-pkgs
  • Loading branch information
timbrinded committed Jul 5, 2024
2 parents c2f6852 + a5d76fc commit 937823b
Show file tree
Hide file tree
Showing 19 changed files with 213 additions and 12 deletions.
6 changes: 0 additions & 6 deletions .changeset/dry-hounds-nail.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
strategy:
fail-fast: false
matrix:
suite: ["dev_test", "dev_multi", "dev_seq"]
suite: ["dev_test", "dev_multi", "dev_seq", "dev_smoke"]
shard: [1, 2, 3, 4]
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @moonwall/docs

## 5.3.0

## 5.2.0

## 5.1.5
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@moonwall/docs",
"type": "module",
"version": "5.2.0",
"version": "5.3.0",
"private": true,
"description": "Testing framework for the Moon family of projects",
"scripts": {
Expand Down
15 changes: 15 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# @moonwall/cli

## 5.3.0

### Minor Changes

- b5f857f: Support skipping tests by ID in config

This feature is amazing but also dangerous! Remember with great power comes great responsibilities

### Patch Changes

- a73230d: downloader fix
- Updated dependencies [b5f857f]
- @moonwall/types@5.3.0
- @moonwall/util@5.3.0

## 5.2.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@moonwall/cli",
"type": "module",
"version": "5.2.0",
"version": "5.3.0",
"description": "Testing framework for the Moon family of projects",
"author": "timbrinded",
"license": "ISC",
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/src/cmds/runTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ export async function executeTests(env: Environment, additionalArgs?: testRunArg
},
} satisfies UserConfig;

// transform in regexp pattern
if (env.skipTests && env.skipTests.length > 0) {
// the final pattern will look like this: "^((?!SO00T02|SM00T01|SM00T03).)*$"
additionalArgs.testNamePattern = `^((?!${env.skipTests?.map((test) => `${test.name}`).join("|")}).)*$`;
}

// TODO: Create options builder class
const options = addThreadConfig(baseOptions, env.multiThreads);

Expand Down
8 changes: 8 additions & 0 deletions packages/types/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @moonwall/types

## 5.3.0

### Minor Changes

- b5f857f: Support skipping tests by ID in config

This feature is amazing but also dangerous! Remember with great power comes great responsibilities

## 5.2.0

### Minor Changes
Expand Down
21 changes: 21 additions & 0 deletions packages/types/config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,27 @@
},
"type": "array"
},
"skipTests": {
"description": "A list of test to skip.",
"items": {
"properties": {
"name": {
"description": "The name of the test to skip. Eg. S22C500",
"type": "string"
},
"reason": {
"description": "The reason for skipping the test. Must be provided. Eg. https://github.com/org/repo/issues/123.",
"type": "string"
},
"since": {
"description": "The date when the test was skipped. Must be provided and be RFC3339 compliant. Eg. 2021-09-01T00:00:00Z",
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"testFileDir": {
"description": "An array of directories with test files.",
"items": {
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@moonwall/types",
"type": "module",
"version": "5.2.0",
"version": "5.3.0",
"description": "Testing framework for the Moon family of projects",
"author": "timbrinded",
"license": "ISC",
Expand Down
22 changes: 22 additions & 0 deletions packages/types/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,28 @@ export type Environment = {
* Toggle whether createBlock() will finalize blocks by default or not.
*/
defaultFinalization?: boolean;

/**
* A list of test to skip.
*/
skipTests?: SkipTestSpec[];
};

export type SkipTestSpec = {
/**
* The name of the test to skip. Eg. S22C500
*/
name: string;

/**
* The reason for skipping the test. Must be provided. Eg. https://github.com/org/repo/issues/123.
*/
reason: string;

/**
* The date when the test was skipped. Must be provided and be RFC3339 compliant. Eg. 2021-09-01T00:00:00Z
*/
since: string;
};

/**
Expand Down
7 changes: 7 additions & 0 deletions packages/util/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @moonwall/util

## 5.3.0

### Patch Changes

- Updated dependencies [b5f857f]
- @moonwall/types@5.3.0

## 5.2.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/util/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@moonwall/util",
"type": "module",
"version": "5.2.0",
"version": "5.3.0",
"description": "Testing framework for the Moon family of projects",
"author": "timbrinded",
"license": "ISC",
Expand Down
12 changes: 12 additions & 0 deletions test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @moonwall/tests

## 5.3.0

### Minor Changes

- b5f857f: Support skipping tests by ID in config

This feature is amazing but also dangerous! Remember with great power comes great responsibilities

### Patch Changes

- a73230d: downloader fix

## 5.2.0

### Minor Changes
Expand Down
34 changes: 34 additions & 0 deletions test/moonwall.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,40 @@
},
"connections": []
},
{
"name": "dev_smoke",
"foundation": {
"launchSpec": {
"disableRuntimeVersionCheck": true
},
"type": "read_only"
},
"connections": [
{
"name": "para",
"type": "polkadotJs",
"endpoints": ["wss://moonbeam-rpc.dwellir.com"]
}
],
"testFileDir": ["/suites/smoke"],
"skipTests": [
{
"name": "SO00T02",
"reason": "https://github.com/moonbeam-foundation/moonbeam/issue/1",
"since": "2024-01-28T00:00:00Z"
},
{
"name": "SM00T01",
"reason": "https://github.com/moonbeam-foundation/moonbeam/issue/2",
"since": "2024-01-28T00:00:00Z"
},
{
"name": "SM00T03",
"reason": "https://github.com/moonbeam-foundation/moonbeam/issue/3",
"since": "2024-01-28T00:00:00Z"
}
]
},
{
"name": "multi_chopsticks",
"testFileDir": ["suites/multi_chopsticks"],
Expand Down
2 changes: 1 addition & 1 deletion test/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@moonwall/tests",
"type": "module",
"version": "5.2.0",
"version": "5.3.0",
"private": true,
"packageManager": "[email protected]",
"description": "Testing framework for the Moon family of projects",
Expand Down
32 changes: 32 additions & 0 deletions test/suites/smoke/test_skipMany.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { describeSuite, expect } from "@moonwall/cli";

describeSuite({
id: "SM00",
title: "New Test Suite",
foundationMethods: "read_only",
testCases: ({ it }) => {
it({
id: "T01",
title: "Skipped Test",
test: () => {
expect(false).to.be.true;
},
});

it({
id: "T02",
title: "Passing test",
test: () => {
expect(true).to.be.true;
},
});

it({
id: "T03",
title: "Skipped test",
test: () => {
expect(false).to.be.true;
},
});
},
});
24 changes: 24 additions & 0 deletions test/suites/smoke/test_skipNone.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { describeSuite, expect } from "@moonwall/cli";

describeSuite({
id: "SN00",
title: "New Test Suite",
foundationMethods: "read_only",
testCases: ({ it }) => {
it({
id: "T01",
title: "Passing Test",
test: () => {
expect(true).to.be.true;
},
});

it({
id: "T02",
title: "Passing test",
test: () => {
expect(true).to.be.true;
},
});
},
});
24 changes: 24 additions & 0 deletions test/suites/smoke/test_skipOne.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { describeSuite, expect } from "@moonwall/cli";

describeSuite({
id: "SO00",
title: "New Test Suite",
foundationMethods: "read_only",
testCases: ({ it }) => {
it({
id: "T01",
title: "Passing Test",
test: () => {
expect(true).to.be.true;
},
});

it({
id: "T02",
title: "Skipped test",
test: () => {
expect(false).to.be.true;
},
});
},
});

0 comments on commit 937823b

Please sign in to comment.