From 3c26c2000c2d9f819209b99cdf75d391dd954e38 Mon Sep 17 00:00:00 2001 From: Andrea Giacobino Date: Thu, 4 Jul 2024 15:04:07 +0200 Subject: [PATCH] test: add test cases --- test/configs/moonwall.skipTest.config.json | 67 ------------------- test/moonwall.config.json | 36 +++++++--- test/suites/smoke/test_skipMany.ts | 32 +++++++++ test/suites/smoke/test_skipNone.ts | 24 +++++++ ...{skipTestsViaConfig.ts => test_skipOne.ts} | 2 +- 5 files changed, 83 insertions(+), 78 deletions(-) delete mode 100644 test/configs/moonwall.skipTest.config.json create mode 100644 test/suites/smoke/test_skipMany.ts create mode 100644 test/suites/smoke/test_skipNone.ts rename test/suites/smoke/{skipTestsViaConfig.ts => test_skipOne.ts} (96%) diff --git a/test/configs/moonwall.skipTest.config.json b/test/configs/moonwall.skipTest.config.json deleted file mode 100644 index 1651944c..00000000 --- a/test/configs/moonwall.skipTest.config.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/Moonsong-Labs/moonwall/main/packages/types/config_schema.json", - "defaultTestTimeout": 120000, - "environments": [ - { - "connections": [ - { - "endpoints": ["wss://wss.api.moonbase.moonbeam.network"], - "name": "ethers", - "type": "ethers" - }, - { - "endpoints": ["wss://wss.api.moonbase.moonbeam.network"], - "name": "para", - "rpc": { - "moon": { - "isBlockFinalized": { - "description": "Just a test method", - "params": [ - { - "name": "blockHash", - "type": "Hash" - } - ], - "type": "bool" - } - } - }, - "type": "polkadotJs" - }, - { - "endpoints": [ - "wss://fro-moon-rpc-1-moonbase-relay-rpc-1.moonbase.ol-infra.network" - ], - "name": "relay", - "type": "polkadotJs" - }, - { - "endpoints": ["wss://wss.api.moonbase.moonbeam.network"], - "name": "viem", - "type": "viem" - } - ], - "contracts": "contracts/", - "foundation": { - "launchSpec": { - "disableRuntimeVersionCheck": true - }, - "type": "read_only" - }, - "multiThreads": false, - "name": "smoke_tests", - "reporters": ["basic", "html"], - "runScripts": ["compile-contracts.ts compile"], - "testFileDir": ["/suites/smoke"], - "skipTests": [ - { - "name": "SC20301", - "reason": "This test is skipped because it is not ready yet", - "since": "2024-01-28T00:00:00Z" - } - ] - } - ], - "label": "DevOps - Smoke Tests - Default Config", - "scriptsDir": "scripts/" - } \ No newline at end of file diff --git a/test/moonwall.config.json b/test/moonwall.config.json index 9ff24764..6d328553 100644 --- a/test/moonwall.config.json +++ b/test/moonwall.config.json @@ -797,19 +797,35 @@ { "name": "dev_smoke", "foundation": { - "launchSpec": { - "disableRuntimeVersionCheck": true - }, - "type": "read_only" + "launchSpec": { + "disableRuntimeVersionCheck": true }, - "connections": [], + "type": "read_only" + }, + "connections": [ + { + "name": "para", + "type": "polkadotJs", + "endpoints": ["wss://moonbeam-rpc.dwellir.com"] + } + ], "testFileDir": ["/suites/smoke"], "skipTests": [ - { - "name": "ST00T02", - "reason": "https://github.com/moonbeam-foundation/moonbeam/issue/1234", - "since": "2024-01-28T00:00:00Z" - } + { + "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" + } ] }, { diff --git a/test/suites/smoke/test_skipMany.ts b/test/suites/smoke/test_skipMany.ts new file mode 100644 index 00000000..c2f9d82c --- /dev/null +++ b/test/suites/smoke/test_skipMany.ts @@ -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; + }, + }); + }, +}); diff --git a/test/suites/smoke/test_skipNone.ts b/test/suites/smoke/test_skipNone.ts new file mode 100644 index 00000000..41062603 --- /dev/null +++ b/test/suites/smoke/test_skipNone.ts @@ -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; + }, + }); + }, +}); diff --git a/test/suites/smoke/skipTestsViaConfig.ts b/test/suites/smoke/test_skipOne.ts similarity index 96% rename from test/suites/smoke/skipTestsViaConfig.ts rename to test/suites/smoke/test_skipOne.ts index 4f8101e4..e9addcac 100644 --- a/test/suites/smoke/skipTestsViaConfig.ts +++ b/test/suites/smoke/test_skipOne.ts @@ -1,7 +1,7 @@ import { describeSuite, expect } from "@moonwall/cli"; describeSuite({ - id: "ST00", + id: "SO00", title: "New Test Suite", foundationMethods: "read_only", testCases: ({ it }) => {