Skip to content

Commit

Permalink
Deprecate /tests folder (#2467)
Browse files Browse the repository at this point in the history
* changed docs

* fix readme

* fix GH comments

* fix ts test

* add moonwall tests to coverage

* fmt

* fix

* fix ts tests
  • Loading branch information
timbrinded authored Sep 4, 2023
1 parent 63160c7 commit 2ea0db7
Show file tree
Hide file tree
Showing 380 changed files with 133 additions and 271 deletions.
5 changes: 4 additions & 1 deletion .github/workflow-templates/dev-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ inputs:
moonwall_environment:
description: Name of the moonwall environment to run tests against.
required: true
force-pass:
description: "Indicate whether the workflow should mark the test step as successful, even if actual test failures occur."
default: "false"

runs:
using: "composite"
Expand Down Expand Up @@ -44,7 +47,7 @@ runs:
cd test
pnpm install
pnpm compile-solidity
pnpm moonwall test ${{ inputs.moonwall_environment }}
pnpm moonwall test ${{ inputs.moonwall_environment }} || [[ '${{ inputs.force-pass }}' == 'true' ]]
- name: Upload HTML report
if: always()
uses: actions/[email protected]
Expand Down
8 changes: 4 additions & 4 deletions .github/workflow-templates/typescript-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ runs:
cd ../typescript-api
npm ci
cd ../tests
cd ../archived_tests
npm ci
#### Prepares and copies the typescript generated API to include in the tests
Expand All @@ -58,15 +58,15 @@ runs:
run: |
#### Compile typescript tests into javascript (more stable for Mocha)
#### This also better display typescript issues
cd ./tests
cd ./archived_tests
npm run build
- name: Execute tests
shell: bash
env:
NODE_OPTIONS: "--max-old-space-size=12288"
run: |
cd ./tests
cd ./archived_tests
node node_modules/.bin/mocha \
--timeout ${{ inputs.timeout }} \
--parallel -j $((CPUS / 4)) \
Expand All @@ -82,7 +82,7 @@ runs:
env:
NODE_OPTIONS: "--max-old-space-size=12288"
run: |
cd ./tests
cd ./archived_tests
# Log npm version to make sure it maches with local version
npm -v
# Make sure git is working, and if not abort early. When git is not working it looks like:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ jobs:
- name: Get tracing runtimes
run: |
./scripts/build-last-tracing-runtime.sh ${{ needs.set-tags.outputs.git_branch }}
mkdir -p tests/moonbase-overrides/
mv build/wasm/moonbase-runtime-local-substitute-tracing.wasm tests/moonbase-overrides/
mkdir -p archived_tests/moonbase-overrides/
mv build/wasm/moonbase-runtime-local-substitute-tracing.wasm archived_tests/moonbase-overrides/
- name: Typescript tracing tests (against dev service)
env:
BINARY_PATH: ../build/moonbeam
Expand All @@ -398,7 +398,7 @@ jobs:
cd ../typescript-api
npm ci
cd ../tests
cd ../archived_tests
npm ci
#### Prepares and copies the typescript generated API to include in the tests
npm run setup-typescript-api
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ jobs:
timeout: 10000
moonbeam-binary: build/moonbeam
force-pass: true
- name: "Run Moonwall Dev Tests"
uses: ./.github/workflow-templates/dev-tests
with:
moonwall_environment: dev_moonbase

- name: Retrieve coverage
id: coverage
run: |
Expand Down
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
/build/

# Generated test specs
/tests/moonbeam-test-specs/*.json
/tests/binaries
/tests/runtimes
/tests/specs
/tests/build
/tests/rococo*.json
/archived_tests/moonbeam-test-specs/*.json
/archived_tests/binaries
/archived_tests/runtimes
/archived_tests/specs
/archived_tests/build
/archived_tests/rococo*.json

# Moonbeam-Launch
*.log
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test/tsconfig.json
/build/

# Generated test specs
/tests/moonbeam-test-specs/*.json
/archived_tests/moonbeam-test-specs/*.json

# Moonbeam-Launch
*.log
Expand Down
22 changes: 0 additions & 22 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,6 @@
"sourceMap": {
"/rustc/*": "${dbgconfig:rustc_path}"
}
},
{
"cwd": "${workspaceFolder}/tests",
"args": [
"--timeout",
"999999",
"--colors",
"-r",
"ts-node/register",
"--inspect-brk",
"${file}"
],
"env": {
"DEBUG": "test:dev-node"
},
"internalConsoleOptions": "openOnSessionStart",
"name": "Mocha Current Opened Test",
"program": "${workspaceFolder}/tests/node_modules/mocha/bin/_mocha",
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"type": "pwa-node",
"port": 9229
}
]
}
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,13 @@ Moonbeam has Rust unit tests as well as typescript integration tests. These test
cargo test
```

```bash
# Install dependencies for integration tests
cd moonbeam-types-bundle
npm i

cd ../tests
npm i
> [!IMPORTANT]\
> If you do not have **pnpm**, you can install with: `npm install -g pnpm`
# Run integration tests
npm test
```bash
cd test
pnpm i
pnpm moonwall test dev_moonbase
```

## Chain IDs
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions archived_tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# DEPRECATED FOLDER

> [!WARNING]
> This directory has been archived! Please instead visit the `/test` directory to see the maintained and currently executed tests for this repository. Whilst tracing tests do get run from here, this is strictly temporary until they are migrated over to the new directory.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 2ea0db7

Please sign in to comment.