Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable rendering MTPs locally for testing #400

Merged
merged 3 commits into from
Jun 28, 2022

Conversation

charlesthomas
Copy link
Contributor

  • bin/renderlocal can take an --mtp, and any number of --envs
    (greater than 0) and render resources, writing them to --out
  • create a LocalMustacheTemplateController that resembles the mocked
    one used in tests
    • update tests to use LocalMustacheTemplateController
  • depends on proposed changes to razeedeploy-core

src/IOUtils.js Outdated Show resolved Hide resolved
@charlesthomas charlesthomas force-pushed the renderlocal branch 2 times, most recently from 8220600 to 2f05d8e Compare June 27, 2022 16:15
Copy link
Member

@alewitt2 alewitt2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some info in the Readme.md on how to use this script for testing, as well as some sample files that someone would use with the script.

@charlesthomas charlesthomas force-pushed the renderlocal branch 2 times, most recently from 840f669 to 6da8ec9 Compare June 27, 2022 19:36
@charlesthomas
Copy link
Contributor Author

Please add some info in the Readme.md on how to use this script for testing, as well as some sample files that someone would use with the script.

i added examples for running w/one or multiple --env args, as well as with the optional --out. all the examples should be runnable, and the example files are in test/example

Copy link
Member

@alewitt2 alewitt2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just updated master to include fixes for audit failures. once this branch is rebuilt with master and has a successful build, it should be good to approve and merge

- `bin/renderlocal` can take an `--mtp`, and any number of `--env`s
  (greater than 0) and render resources, writing them to `--out`
- create a `LocalMustacheTemplateController` that resembles the mocked
  one used in tests
  - update tests to use `LocalMustacheTemplateController`
- depends on proposed changes to `razeedeploy-core`
- `bin/renderlocal` now imports `test/lib/LocalRenderer`
  - this allows other node projects that include MTPs to be able to use
    the `LocalRenderer` in their own tests
- also addresses PR feedback:
  - items previously added to `src` are now in `test/lib`
  - `razeedeploy-core` PR was updated to remove logic defaulting
    namespaces. that logic has been moved here in
    `test/lib/IOUtils.js`'s `kubeDataFromYamlFiles` method and a warning
    is emitted when it defaults
- examples should be copy/paste-able from the root of the repo
- included:
  - single and multiple `--env` arguments
  - with and without `--out` option
@charlesthomas
Copy link
Contributor Author

i just updated master to include fixes for audit failures. once this branch is rebuilt with master and has a successful build, it should be good to approve and merge

done!

@alewitt2
Copy link
Member

thanks for the contribution

@alewitt2 alewitt2 changed the title feat: enable rendering MTPs to disk, from disk feat: render MTPs locally for testing Jun 28, 2022
@alewitt2 alewitt2 merged commit d1a54fb into razee-io:master Jun 28, 2022
@alewitt2 alewitt2 changed the title feat: render MTPs locally for testing feat: enable rendering MTPs locally for testing Jun 28, 2022
alewitt2 pushed a commit that referenced this pull request Jun 28, 2022
* feat: enable rendering MTPs to disk, from disk

- `bin/renderlocal` can take an `--mtp`, and any number of `--env`s
  (greater than 0) and render resources, writing them to `--out`
- create a `LocalMustacheTemplateController` that resembles the mocked
  one used in tests
  - update tests to use `LocalMustacheTemplateController`
- depends on proposed changes to `razeedeploy-core`

* feat: make `LocalRenderer` importable

- `bin/renderlocal` now imports `test/lib/LocalRenderer`
  - this allows other node projects that include MTPs to be able to use
    the `LocalRenderer` in their own tests
- also addresses PR feedback:
  - items previously added to `src` are now in `test/lib`
  - `razeedeploy-core` PR was updated to remove logic defaulting
    namespaces. that logic has been moved here in
    `test/lib/IOUtils.js`'s `kubeDataFromYamlFiles` method and a warning
    is emitted when it defaults

* docs: add `bin/renderlocal` to README w/examples

- examples should be copy/paste-able from the root of the repo
- included:
  - single and multiple `--env` arguments
  - with and without `--out` option
@charlesthomas charlesthomas deleted the renderlocal branch June 28, 2022 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants