[STAL-2820] feat: add end-to-end testing for R, Rust, and SQL #505
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem are you trying to solve?
We've added support for several new languages in the analyzer, but we haven't added proper end-to-end testing to ensure that we can write rules in the rule editor for these languages, retrieve them from the backend, run them in the analyzer, and get some number of results back.
What is your solution?
This PR adds 3 integration test files, named
integration-test-{lang}.sh
which incorporate the same logic as the other currently existing integration scripts. It downloads a repository that is a project written mostly in the target language, writes a config file to use the{lang}-inclusive
and{lang}-code-style
rulesets in the cloned path, and executes the analyzer in this path. Each language has afunction-name-min-length
andcomments
rule which are in thecode-style
andinclusive
rulesets for each language. We expect to get at least two results in each case; currently the R repo has 10 results, the Rust one 9, and the SQL one 27. While there might be slight variation in the number of results over time as the repository changes, we're not likely to see this number go below 2.These three integration test scripts have been added to the
integration-tests
GitHub CI job as well to check for any regressions/issues.Alternatives considered
What the reviewer should know