-
Notifications
You must be signed in to change notification settings - Fork 319
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
End to End Testing (Java) #551
Conversation
Already in preparation: |
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.
Some initial remarks :)
jplag.endToEndTesting/src/main/java/de/jplag/endToEndTesting/helper/JPlagTestSuiteHelper.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/main/java/de/jplag/endToEndTesting/helper/JPlagTestSuiteHelper.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/main/java/de/jplag/endToEndTesting/helper/JPlagTestSuiteHelper.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/main/java/de/jplag/endToEndTesting/helper/JsonReader.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/test/java/jplag/endToEndTesting/javaTestCases.java
Outdated
Show resolved
Hide resolved
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.
Also from me a quick early review.
jplag.endToEndTesting/src/main/java/de/jplag/endToEndTesting/constants/Constant.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/main/java/de/jplag/endToEndTesting/helper/JPlagTestSuiteHelper.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/main/java/de/jplag/endToEndTesting/helper/JPlagTestSuiteHelper.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/main/java/de/jplag/endToEndTesting/helper/JPlagTestSuiteHelper.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/main/java/de/jplag/endToEndTesting/helper/JPlagTestSuiteHelper.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/main/java/de/jplag/endToEndTesting/helper/JsonReader.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/main/java/de/jplag/endToEndTesting/helper/ResultComparison.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/test/java/jplag/endToEndTesting/javaTestCases.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/test/java/jplag/endToEndTesting/javaTestCases.java
Outdated
Show resolved
Hide resolved
…unctions with the new architecture. Unclear code was removed or replaced
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.
Some more comments. Also merge master
to your branch :)
jplag.endToEndTesting/src/main/java/de/jplag/endToEndTesting/helper/JPlagTestSuiteHelper.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/main/java/de/jplag/endToEndTesting/helper/JPlagTestSuiteHelper.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/main/java/de/jplag/endToEndTesting/helper/JsonHelper.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/main/java/de/jplag/endToEndTesting/helper/JsonHelper.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/test/java/jplag/endToEndTesting/javaTestCases.java
Outdated
Show resolved
Hide resolved
Also add it to the module structure. (to the default profile; not to the deployment profile) |
…iled information to better understand the subsequent analysis of "why a test is failed".
…ssible static paths
…constant path variables
jplag.endToEndTesting/src/test/java/jplag/endToEndTesting/javaTestCases.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/test/java/jplag/endToEndTesting/javaTestCases.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/test/java/jplag/endToEndTesting/javaTestCases.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/test/java/jplag/endToEndTesting/javaTestCases.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/test/java/jplag/endToEndTesting/javaTestCases.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/test/java/jplag/endToEndTesting/javaTestCases.java
Outdated
Show resolved
Hide resolved
First of all, thanks for the quick help! I have now adjusted the pom's. Regarding the name for the test cases. Is it wanted that the endToEnd tests run every time? Especially I still implement the "test case" which puts the cached results into the json. This should not run with the build in any case. |
I think the E2E test have to run at any build. Just ensure that the state of your committed E2E test is runnable. You can change the tests later if needed.
If this is not a real test. Simply mark it with |
Did I forget something when checking the JavaResult.json file or why can't it be found? Locally it works but in the build test run it cannot be found. However, the previously required resource Directoire is found. Click to show!Build error
Checking the paths and files in JavaEndToEndTest.java @BeforeAll
public void setUp() throws IOException {
jplagTestSuiteHelper = new JPlagTestSuiteHelper(LanguageOption.JAVA);
assertTrue(Constant.BASE_PATH_TO_JAVA_RESOURCES_SORTALGO.toFile().exists(), "Could not find base directory!");
assertTrue(Constant.BASE_PATH_TO_JAVA_RESULT_JSON.toFile().isFile(), "Could not find java result json!");
} Specified paths in Constant.java /**
* Base path to the created plagiarism and the main file located in the project resources.
*/
public static final Path BASE_PATH_TO_JAVA_RESOURCES_SORTALGO = Path.of("src", "test", "resources", "java", "sortAlgo");
/**
* Base path to the saved results of the previous tests in a *.json file
*/
public static final Path BASE_PATH_TO_JAVA_RESULT_JSON = Path.of("src", "test", "resources", "results", "javaResult.json"); |
jplag.endToEndTesting/src/main/java/de/jplag/end_to_end_testing/constants/Constant.java
Outdated
Show resolved
Hide resolved
…g/constants/Constant.java
Linux FS is case sensitive. Build is fixed now. |
jplag.endToEndTesting/src/test/java/de/jplag/end_to_end_testing/JavaEndToEndTest.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/main/java/de/jplag/end_to_end_testing/model/ResultModel.java
Outdated
Show resolved
Hide resolved
jplag.endToEndTesting/src/main/java/de/jplag/end_to_end_testing/constants/Constant.java
Outdated
Show resolved
Hide resolved
Is there anything else missing from the PR? This already includes the basic tests, resources and helper functions. The additional functions for the EndToEndTests are intended for the next PR but are already in progress. |
Both @dfuchss and I will check your changes, and then we will either accept or make some further comments. Probably not today, though. |
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.
I've marked some locations that I would not log. Please wait for @tsaglam opinion here, as these suggestions are just a personal opinion of me. I would suggest to either delete them or to use logger.debug() . Otherwise, the output will contain too much (from my point of view)
But that's a very minor remark. Therefore, I approve now.
...g.endToEndTesting/src/main/java/de/jplag/end_to_end_testing/helper/JPlagTestSuiteHelper.java
Outdated
Show resolved
Hide resolved
...g.endToEndTesting/src/main/java/de/jplag/end_to_end_testing/helper/JPlagTestSuiteHelper.java
Outdated
Show resolved
Hide resolved
...g.endToEndTesting/src/main/java/de/jplag/end_to_end_testing/helper/JPlagTestSuiteHelper.java
Outdated
Show resolved
Hide resolved
...g.endToEndTesting/src/main/java/de/jplag/end_to_end_testing/helper/JPlagTestSuiteHelper.java
Outdated
Show resolved
Hide resolved
I definitely agree with you about the logger. The outputs could also be sufficient purely for the debug version. |
Both are fine for me, but |
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.
Just one small thing...
jplag.endToEndTesting/src/main/java/de/jplag/end_to_end_testing/constants/Constant.java
Outdated
Show resolved
Hide resolved
… with naming conventions
Since I only created the PR as a draft, should I create it the PR now? |
This already is a non-draft PR. What is an argument against merging this one? |
I had it set up as a draft and was not aware that it had already been changed. I will create a readMe file for the RP, but then everything would be ready so far. |
Kudos, SonarCloud Quality Gate passed! |
First version of the endToEndTest strategy for jplag.java
The first endToEnd tests are included, as well as the required auxiliary classes and the plagiarisms created from the literature for each test.
The test cases each contain two delivery classes, which consists of the original file "SortAlgo.java" as well as a plagiarized file.
The plagiarisms were created and added to the project as described in the associated issue.
Test-Workflow
TODO