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

Feature: Run all tests from a folder #397

Merged
merged 1 commit into from
Nov 14, 2022
Merged

Conversation

dmitry-zaitsev
Copy link
Contributor

Running all tests in the folder (excluding subfolders)

image

There are some TODOs in the PR that are there in preparation for test reporting

@Leland-Takamine
Copy link
Contributor

Just confirming - when running against a single file the output is the same as before correct?

@dmitry-zaitsev
Copy link
Contributor Author

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

Comment on lines +52 to +58
var passed = true
flows.forEach { flowFile ->
val result = runFlow(flowFile, env, maestro)

if (result.status == FlowStatus.ERROR) {
passed = false
}
Copy link
Contributor

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()

Copy link
Contributor Author

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"
Copy link
Contributor

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.

Copy link
Contributor Author

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

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.

None yet

3 participants