Skip to content

Commit

Permalink
add autogen tool
Browse files Browse the repository at this point in the history
Signed-off-by: Jeromy Cannon <jeromy@swirldslabs.com>
  • Loading branch information
jeromy-cannon committed Sep 11, 2024
1 parent 36ce604 commit 1880bbb
Show file tree
Hide file tree
Showing 11 changed files with 1,953 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/autogen/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
env:
browser: true
es2021: true
extends: standard
parserOptions:
ecmaVersion: latest
sourceType: module
overrides:
- files: ["*.mjs"]
parserOptions:
ecmaVersion: latest
sourceType: module
rules:
"no-template-curly-in-string": "off"
42 changes: 42 additions & 0 deletions .github/workflows/autogen/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Solo autogen tool

## Description

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

## Usage

from solo root directory:
```bash
cd .github/workflows/autogen
npm install
npm run autogen
```

Use git to detect file changes and validate that they are correct.

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.
```bash
template.flow-build-application.yaml
template.flow-pull-request-checks.yaml
template.zxc-code-analysis.yaml
template.zxc-env-vars.yaml
```
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.

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.

e.g.:
```yaml
- name: Mirror Node
jestPostfix: --testRegex=\".*\\/e2e\\/commands\\/mirror_node\\.test\\.mjs\"

```

## Development

To run lint fix:
```bash
cd .github/workflows/autogen
eslint --fix .
```
20 changes: 20 additions & 0 deletions .github/workflows/autogen/autogen.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node
/**
* Copyright (C) 2024 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the ""License"");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an ""AS IS"" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import * as fnm from './src/index.mjs'

fnm.main(process.argv)
Loading

0 comments on commit 1880bbb

Please sign in to comment.