Repository parser tests (using old SimilarityChecker)#17
Open
AlpTorac wants to merge 72 commits intoCIPM-tools:build-pipelinefrom
Open
Repository parser tests (using old SimilarityChecker)#17AlpTorac wants to merge 72 commits intoCIPM-tools:build-pipelinefrom
AlpTorac wants to merge 72 commits intoCIPM-tools:build-pipelinefrom
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
HansMartinA
requested changes
Aug 14, 2025
Comment on lines
43
to
60
| @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; | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
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, |
Member
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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