-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rework init * readd config * change default testcases * add schema to config * update docs
- Loading branch information
1 parent
626e860
commit bfaa04e
Showing
11 changed files
with
270 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@moonwall/types": minor | ||
"@moonwall/cli": minor | ||
"@moonwall/docs": minor | ||
--- | ||
|
||
Updated `init` command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,77 @@ | ||
# Init | ||
|
||
The moonwall `init` command walks you through a step-by-step process to setting up your `moonwall.config.json` file. | ||
The `init` command guides you through a step-by-step process to create a configuration file for Moonwall. This command will set up a new `moonwall.config.json` file in your current directory—provided one does not already exist. | ||
|
||
The command takes no parameters but you'll be asked for the following to complete the setup of your `moonwall.config.json` file. Press `enter` at each step to accept the default parameters or enter your own at each step. These parameters and their default values are listed below: | ||
When you run: | ||
|
||
- Label: *moonwall_config* | ||
- Global timeout value: *30000* | ||
- Environment Name: *default_env* | ||
- Path for where tests for this environment are kept: *tests/* | ||
- Network Foundation: *dev* | ||
- Would you like to generate this config? (no to restart from beginning) (Y/n) *Y* | ||
`pnpm moonwall init` | ||
|
||
For more details about configuring your `Moonwall.config` see the [Quick Start Guide](/guide/test/quick-start). | ||
::: tip | ||
You can provide the option `--acceptAllDefaults` to YOLO the defaults and save a config file immediately. | ||
::: | ||
|
||
![Moonwall init terminal screenshot](/init.png) | ||
you will be prompted to enter a few key configuration values. Press `Enter` at each prompt to accept the default value or type your own. The prompts include: | ||
|
||
- **Label:** The name for your config file. | ||
_Default: `moonwall_config`_ | ||
|
||
- **Global Timeout:** The default timeout for tests (in milliseconds). | ||
_Default: `30000`_ | ||
|
||
- **Environment Name:** The name of the Moonwall environment you want to create first (you can always make as many new environments as you like). | ||
_Default: `default_env`_ | ||
|
||
- **Test Directory:** The path where tests for this environment are stored. | ||
_Default: `tests/default/`_ | ||
|
||
::: info | ||
By default, the `foundation` is set to `dev` but you can change it to `chopsticks`, `zombie`, or `read_only` as required. | ||
::: | ||
|
||
After enter and confirming these values, the following will happen: | ||
|
||
- Creates the directories `scripts`, `tests`, and `tmp` (if they don’t already exist). | ||
- Generates a new `moonwall.config.json` file with your specified settings. | ||
- Writes a sample test file into your test directory to help you get started. | ||
|
||
## Generated Configuration Example | ||
|
||
Below is an example of the generated `moonwall.config.json`: | ||
|
||
```json | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/Moonsong-Labs/moonwall/main/packages/types/config_schema.json", | ||
"label": "moonwall_config", | ||
"defaultTestTimeout": 30000, | ||
"environments": [ | ||
{ | ||
"name": "default_env", | ||
"testFileDir": ["tests/default/"], | ||
"multiThreads": false, | ||
"foundation": { | ||
"type": "dev", | ||
"launchSpec": [ | ||
{ | ||
"name": "moonbeam", | ||
"useDocker": true, | ||
"newRpcBehaviour": true, | ||
"binPath": "moonbeamfoundation/moonbeam" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
``` | ||
|
||
After initialization, a sample test file is created in the specified test directory so you can immediately begin writing tests for your local dev environment. | ||
|
||
The tests should run successfully with default settings, as it will use a moonbeam docker image to spin up a local dev environment. You can modify this environment to whichever substrate node binary location or docker as you like. | ||
|
||
::: info | ||
If a `moonwall.config.json` file already exists, the init command will abort to prevent overwriting your configuration. Remove or rename the existing file if you wish to run the init process again. | ||
::: | ||
|
||
For more details about configuration options and further customization, please see the [Quick Start Guide](/guide/test/quick-start). | ||
|
||
![Moonwall init terminal screenshot](/init.png) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.