-
Notifications
You must be signed in to change notification settings - Fork 6
Repository parser tests (using old SimilarityChecker) #17
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
base: build-pipeline
Are you sure you want to change the base?
Conversation
Removed project-specific settings for fitests
with default methods that are the standard JaMoPP tests
for parser tests
that analyses Resource file content
in parser tests
The idea is to spare multiple test classes for the same test repository. With this interface it is possible to just have a list of commits and then to iterate them in certain ways.
It contains a template method @testfactory createTests(...) for generating dynamic parser tests. This way, dynamic test generation can be re-used in future repository parser tests.
in Java source files Note: Commentary removal is only an approximation
Assumes reflexivity, symmetry and transitivity properties (explained in RepoTestResultCache commentary)
that provides cached expected similarity results
| @Override | ||
| protected Collection<AbstractJaMoPPParserSimilarityTestFactory> getTestFactories() { | ||
| var res = new ArrayList<AbstractJaMoPPParserSimilarityTestFactory>(); | ||
| res.add(new EAllContentSimilarityTestFactory(this.getSCC())); | ||
| // TODO Determine whether the order of Resource contents should matter | ||
| // Especially important due to synthetic elements from TrivialRecovery | ||
| // Use ModelComparisonTestFactory(boolean) to set it (true by default) | ||
| res.add(new ModelComparisonTestFactory()); | ||
| res.forEach((tf) -> tf.setExpectedSimilarityResultProvider(getExpectedSimilarityResultProviderForCommits())); | ||
| return res; | ||
| } | ||
|
|
||
| @Override | ||
| protected RepoParserTestOptions initResourceTestOptions() { | ||
| var opts = super.initResourceTestOptions(); | ||
| opts.setShouldDeleteRepositoryClones(true); | ||
| return opts; | ||
| } | ||
| } |
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 is a code duplication, which should be avoided. The same code is also in the TeammatesRepoTest class.
| protected Resource prepareArtificialResource(Resource modelResource, URI artificialResourceURI) { | ||
| var modelResourceSet = modelResource.getResourceSet(); | ||
|
|
||
| protected Resource prepareArtificialResource(ResourceSet modelResourceSet, List<Resource> directModelResources, |
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.
The JavaDoc and maybe the method name needs to be updated.
to local repository clone removal
Remove ILoggable
Move Resource factory registry setup to resource parsing strategy
Edit commentary
Edit its commentary
To match the terminology in README.md
Relativize paths and URIs to hide sensitive data in paths Gather all time measurement files generated from a test run within a folder, so that it is possible to tell what time measurements are taken from which test runs
…tate ResourceContentSimilarityResultProvider is currently only used by ModelComparisonTestFactory as default provider. It is however currently changed in all concrete tests, so that this fix makes no difference
now subtypes can copy attributes from supertypes
Edit commentary
Edit commentary
to ensure saved time measurements are parseable via GSON
to provide an introduction and terminology
to provide an introduction and link to the README of fitests plug-in
The time measurement sample file touched by GIT had its line separator(s) replaced with the one for UNIX systems. This led to the parsed and re-serialised file in the tests to have slightly different contents (line separators). Solved by using FileUtil to get their effective content.
Introduction
This pull request (based on fd6d6e8) introduces repository parser tests and their pre-requisites.
Contains tests for the Teammates repository and the Corona Warn App Server repository. The tests include the commits from the corresponding CI tests in "vsum.tests" (5 commits for Teammates, 8 commits for cwa-server).
All tests under cipm.consistency.fitests.repositorytests run successfully at the time of writing this description.
About this pull request
2 plug-ins "fitests" (cipm.consistency.fitests) and "fitests.repositorytests" (cipm.consistency.fitests.repositorytests) are included in this pull requests. "fitests" provides the classes that were originally planned and used by "unittests" (see #14 ), which are needed by repository parser tests as well. "fitests.repositorytests" contains repository-relevant classes including: Repository parser tests, diff patch analysis, (approximative) commentary removal, expected similarity result computation and model resource caching.
Despite "fitests" being introduced in earlier pull requests (such as #14 ), this pull request does not require the refactoring changes (proposed in #9 and #10 ) to FirstInstance bundles. Commits introduced here only create the 2 aforementioned plug-ins and do not modify anything else, except for the .gitignore file in 486fe38, in order to exclude generated test resource files for parser tests.
To keep this pull request as simple as possible, numerous classes and methods from the "fitests" plug-in have been left out (see #14 ).
To discuss
2.1. Whether ParserTestTimeMeasurer class should be used for measuring time
2.2. Tags used for time measuring
2.3. Positions in code where time is measured
2.4. How time measurements are saved