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

Script unit tests #148

Open
wneirynck opened this issue Apr 26, 2024 · 0 comments
Open

Script unit tests #148

wneirynck opened this issue Apr 26, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@wneirynck
Copy link
Contributor

An important part of coding is testing. Since MonkeyCI build scripts are actually small programs, we also need a way to verify their functionality. We should support script unit tests. These should be included in the build script (e.g. build_test.clj) and verify the build script integrity. The tests can be run from the cli, but would also automatically run when triggering a build.

Tests should run in a sandbox, where jobs are faked, although the user can provide custom job results. It is however not possible for us to fake everything: if the build script contains some custom piece of code that performs a side effect, it is up to the user to make sure this does not happen in tests. To this end, the build runtime will contain a flag that indicates whether the script is run in test mode or not.

Should a script test fail, the build will also fail.

@wneirynck wneirynck added the enhancement New feature or request label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant