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 functional tests #72

Merged
merged 145 commits into from
Jun 26, 2024
Merged

Add functional tests #72

merged 145 commits into from
Jun 26, 2024

Conversation

AnetteTaivere
Copy link
Contributor

@AnetteTaivere AnetteTaivere commented Jun 6, 2024

Adds functional tests for the following functionalities:

  • Analysis: tests triggering, starting and completing the analysis with appropriate messages shown to the user if the analysis succeeds or fails, as well as the functionality of aborting the previous analysis when a new one is started;
  • GobPie configuration: tests reading and processing all GobPie configurations correctly with appropriate messages shown to the user if reading configuration fails;
  • Goblint configuration: tests if refreshing Goblint configuration works as intended and if the user is notified with appropriate messages if the refreshing process fails;
  • Goblint messages: tests if the messages received by Goblint are correctly processed, converted and passed to the MagpieBridge server;
  • Goblint server: tests that Goblint is run correctly;

Bug fixes:

  • The process listener intended only for the Goblint process was also added to the preAnalyze process;
  • The user was not notified if there was an unknown configuration present in the GobPie configuration file (added GobPieValidatorAdapter)`;
  • The explodeGroupWarnings setting was not only applied for the data race warnings but also exploded the group warnings that communicate the statistics of dead code and accesses;

Refactorings:

  • Some of the logic of pre-analysis was handled in the getter method that is now moved to the preAnalyse method;
  • Added a new class, GoblintConfWatcher, that is passed to the GoblintAnalysis constructor as an argument instead of initializing goblintConfWatcher field with a new FileWatcher inside the constructor; The functionalities concerning refreshing the Goblint configuration were also moved to this class instead of being in the GoblintAnalysis class that should be only responsible for the functionalities concerning the analysis itself;
  • The runCommand, preAnalyse and abortAnalysis methods were moved from the GoblintAnalysis class to GoblintServer;
  • Added a Builder for GobPieConfiguration to ease testing;
  • Some classes, where the fields were initialized only once (mainly the classes corresponding to the Goblint server responses) were converted to records;
  • Added equals methods for many of the classes for testing purposes;
  • Some methods were made public for being able to call them in the tests;
  • Some restructuring of the classes into different packages based on their main functionality:
    • Classes GoblintSocketMessageConsumer.java and GoblintSocketMessageProducer.java were moved from src/main/java/api/json to src/main/java/api/jsonrpc, so that in the json package, there are only JSON handlers and adapters;
    • Classes that override specific MagpieBridge functionalities were moved to a separate package src/main/java/magpiebridge

Coverage:

  • Adds workflow to upload coverage to Coveralls

karoliineh and others added 30 commits January 11, 2024 18:47
* Remove duplicated junit dependencies from pom
* Fix surefire plugin error by adding junit dependency
* Remove unused imports
* Add ability to check for logging messages
* Format code
* Fix preAnalyseTest
@karoliineh karoliineh added the testing Improvements or additions to testing label Jun 6, 2024
@karoliineh karoliineh linked an issue Jun 6, 2024 that may be closed by this pull request
2 tasks
@karoliineh karoliineh merged commit 4c2b625 into goblint:master Jun 26, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Improvements or additions to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set up automatic testing
3 participants