-
Notifications
You must be signed in to change notification settings - Fork 250
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
Feature: Run all tests from a folder #397
Conversation
Just confirming - when running against a single file the output is the same as before correct? |
Correct, a single file gives the same output. I've been thinking to add some sort of flag to allow to change that behaviour, but that makes for an awkward API so I suggest we continue to differentiate based on folder/non-folder file type |
var passed = true | ||
flows.forEach { flowFile -> | ||
val result = runFlow(flowFile, env, maestro) | ||
|
||
if (result.status == FlowStatus.ERROR) { | ||
passed = false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels a bit fragile, though currently not an issue. The code assumes passed = true, then has a condition to set passed to false.
There is no way that the runFlow can except out so that passed is true but the test failed. Still it would be nice to tight this code down a bit more. For example by having a successCount = 0
then adding 1 for each successful test. Then success will be successCount == flows.count()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the counter to be quite less intuitive than a boolean as it simply has many more possible states and in fact is not going to be used as a counter
.filter { | ||
it.isFile | ||
&& it.extension in setOf("yaml", "yml") | ||
&& it.nameWithoutExtension != "config" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also ignore files starting with underscore. That way users can quickly disable tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am planning to introduce an ignore: true
in flows later on so that we can have an explicit support for that
Running all tests in the folder (excluding subfolders)
There are some TODOs in the PR that are there in preparation for test reporting