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

✨ Add new command to run YAML tests #166

Merged
merged 9 commits into from
Mar 18, 2024

Conversation

pranavgaikwad
Copy link
Contributor

@pranavgaikwad pranavgaikwad commented Feb 28, 2024

  • Adds a new package testing that defines APIs and implementations for writing and running YAML rules tests.
  • Adds a new CLI command to execute the runner with given input

I have tried to group commits to make it a little bit easier to review. See individual commit messages for details, let me know if you have any questions.

@pranavgaikwad pranavgaikwad force-pushed the testRunner branch 3 times, most recently from ca5cdec to bba8c38 Compare February 28, 2024 19:00
@pranavgaikwad pranavgaikwad marked this pull request as ready for review February 28, 2024 19:15
@pranavgaikwad pranavgaikwad force-pushed the testRunner branch 4 times, most recently from 8512eae to 3b6e1e8 Compare February 29, 2024 14:39
Copy link
Collaborator

@eemcmullan eemcmullan left a comment

Choose a reason for hiding this comment

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

Nice work! Thank you for these changes.

docs/testrunner.md Outdated Show resolved Hide resolved
docs/testrunner.md Outdated Show resolved Hide resolved
logFile.Close()
continue
}
analysisParams := tests[0].TestCases[0].AnalysisParams
Copy link
Collaborator

Choose a reason for hiding this comment

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

Something to future-proof if the spec changes?

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 wouldn't worry about this, if the spec changes, the whole logic of the runner will be affected, so we will have to handle that anyway.

pkg/testing/runner.go Outdated Show resolved Hide resolved
Copy link
Contributor

@shawn-hurley shawn-hurley left a comment

Choose a reason for hiding this comment

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

This is a lot of code, so I hope I didn't miss something, but things generally look good to me.

README.md Show resolved Hide resolved
rulesSummary.passed += 1
}
}
fmt.Fprintln(w, strings.Repeat("-", 60))
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if there is a utility to help output formatting like this?

Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
@pranavgaikwad pranavgaikwad force-pushed the testRunner branch 2 times, most recently from 657d07f to 8963dbd Compare March 14, 2024 19:05
Copy link
Contributor

@shawn-hurley shawn-hurley left a comment

Choose a reason for hiding this comment

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

This PR still looks good to me

Signed-off-by: Pranav Gaikwad <pgaikwad@redhat.com>
@pranavgaikwad pranavgaikwad merged commit 8cbeb54 into konveyor:main Mar 18, 2024
2 checks passed
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.

3 participants