Skip to content

Commit e6c79eb

Browse files
feat: add the autogen tool to easily add e2e tests and run it for the first time & fix copyFrom (#566)
Signed-off-by: Jeromy Cannon <[email protected]>
1 parent 32dcf0c commit e6c79eb

22 files changed

+2155
-144
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
env:
2+
browser: true
3+
es2021: true
4+
extends: standard
5+
parserOptions:
6+
ecmaVersion: latest
7+
sourceType: module
8+
overrides:
9+
- files: ["*.mjs"]
10+
parserOptions:
11+
ecmaVersion: latest
12+
sourceType: module
13+
rules:
14+
"no-template-curly-in-string": "off"

.github/workflows/autogen/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Solo autogen tool
2+
3+
## Description
4+
5+
The Solo autogen tool is used to add e2e test cases that need to be ran independently as their own job into the GitHub workflows and into the solo package.json
6+
7+
## Usage
8+
9+
from solo root directory:
10+
```bash
11+
cd .github/workflows/autogen
12+
npm install
13+
npm run autogen
14+
```
15+
16+
Use git to detect file changes and validate that they are correct.
17+
18+
The templates need to be maintained, you can either make changes directly to the templates and then run the tool, or make changes in both the workflow yaml files and the templates. Should the templates fall out of sync, then you can update the templates so that when autogen runs again, the git diff will better match.
19+
```bash
20+
template.flow-build-application.yaml
21+
template.flow-pull-request-checks.yaml
22+
template.zxc-code-analysis.yaml
23+
template.zxc-env-vars.yaml
24+
```
25+
For new e2e test jobs update the `<solo-root>/.github/workflows/templates/config.yaml`, adding a new item to the tests object with a name and jestPostfix attribute.
26+
27+
NOTE: IntelliJ copy/paste will alter the escape sequences, you might have to manually type it in, clone a line, or use an external text editor.
28+
29+
e.g.:
30+
```yaml
31+
- name: Mirror Node
32+
jestPostfix: --testRegex=\".*\\/e2e\\/commands\\/mirror_node\\.test\\.mjs\"
33+
34+
```
35+
36+
## Development
37+
38+
To run lint fix:
39+
```bash
40+
cd .github/workflows/autogen
41+
eslint --fix .
42+
```

.github/workflows/autogen/autogen.mjs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env node
2+
/**
3+
* Copyright (C) 2024 Hedera Hashgraph, LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the ""License"");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an ""AS IS"" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
import * as fnm from './src/index.mjs'
19+
20+
fnm.main(process.argv)

0 commit comments

Comments
 (0)