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

Support env and repeat #1

Merged
merged 9 commits into from
May 28, 2024
Merged

Support env and repeat #1

merged 9 commits into from
May 28, 2024

Conversation

jonsmock
Copy link
Collaborator

Getting some basics in place now that we are getting some very early initial users internally.

  • removes setup/teardown steps
  • changes 'tests' from a sequence to a mapping
  • adds support for (simple) 'env' key/vals
  • adds support for retries with the 'repeat' key
  • adds validation for all of the above using ajv

Also includes some minor cleanup and preparation for CLJS tests.

jonsmock added 8 commits May 16, 2024 17:02
Remove the node version warning.
scripts/nbb can be symlinked from anywhere and will:

- find nbb or return an error to the user
- setup the appropriate classpath
- run a cljs file of the same name in the target/current directory
Runs tests with nbb during development and in GHA workflows. Runs tests
with shadow-cljs when building Docker images, failing the build when tests
fail.
Simplifying the implementation before adding more features, and
introducing expected user-impacting changes now to minimize future
breakage for early adopters.

Test ids support 'needs'-based control flow and other potential
functionality, so make 'tests' a mapping.

Remove setup/teardown steps for the suite and test levels, which
complicate the code and will likely be replaced by other control flow
features and/or reusable steps.
Defines a JSON Schema specification for test suite input.

Additionally, normalize the suite after validation. Test ids, while not
currently used, should be normalized from keywords to strings (as should
any user-provided identifier).
Allow users to create env maps at the suite, test, or step levels.
env values are coerced to strings by ajv.

env keys are normalized as strings. This simplifies passing them to
dockerode and will be useful when we add expressions that reference env
variables.

Upgrade shadow-cljs to get ClojureScript version with
update-keys/update-vals.
Allows retrying exec/run commands until they succeed. API for 'repeat'
inspired by docker compose's 'healthcheck' options.

Supplying 'repeat' without setting 'retries' will retry indefinitely.
@jonsmock jonsmock requested a review from kanaka May 22, 2024 14:08
Copy link
Collaborator

@kanaka kanaka left a comment

Choose a reason for hiding this comment

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

Minor comment, but otherwise looks good.

@@ -0,0 +1,103 @@
;; Copyright (c) 2024, Viasat, Inc
Copy link
Collaborator

Choose a reason for hiding this comment

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

A good chunk of this I think originally came or was derived from cljs.utils. Since you're now pulling that dep in for repeat/retry functionality, seems like you could use other utils too instead of redefining them here.

Use functions from cljs-utils instead of redefining them.
@jonsmock jonsmock merged commit 8d82755 into main May 28, 2024
4 checks passed
@jonsmock jonsmock deleted the support-env-and-repeat branch May 28, 2024 14:43
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