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

Development: Fix execution of exercise template integration tests on Linux systems #9844

Conversation

b-fein
Copy link
Contributor

@b-fein b-fein commented Nov 21, 2024

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) and too complex database calls.
  • I strictly followed the principle of data economy for all database calls.
  • I strictly followed the server coding and design guidelines.
  • I added multiple integration tests (Spring) related to the features (with a high test coverage).
  • I documented the Java code using JavaDoc style.

Motivation and Context

The tests require an installation of Maven and Java 17 to run. On Linux systems, one approach to find Java 17 was using /usr/libexec/java_home. However, this tool is specific to Mac systems, thus resulting in always failing tests.

Description

  • Only calls /usr/libexec/java_home on Mac systems.
  • Instead of failing the tests if Maven or Java 17 cannot be found, skip them. This is achieved by using JUnit assumptions. Gradle tests can still be executed in case Maven could not be found but Java 17 was found.

Steps for Testing

Prerequisites:

  • local development setup
  1. Run the tests in ProgrammingExerciseTemplateIntegrationTest. If either Maven or Java 17 cannot be found, they are skipped instead of failing. If both Maven and Java 17 can be found, they are executed (like e.g. in the CI pipeline on Bamboo or GitHub Actions).

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

unchanged


@coderabbitai ignore

@github-actions github-actions bot added tests programming Pull requests that affect the corresponding module labels Nov 21, 2024
@b-fein b-fein force-pushed the bugfix/development/improve-template-integration-tests-on-linux branch from d8d662d to 709fb31 Compare November 21, 2024 08:18
@b-fein b-fein marked this pull request as ready for review November 21, 2024 08:36
@b-fein b-fein requested a review from a team as a code owner November 21, 2024 08:36
@b-fein b-fein requested a review from chrisknedl November 21, 2024 08:37
Copy link
Contributor

@Strohgelaender Strohgelaender left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, code looks good.

Copy link
Contributor

@SimonEntholzer SimonEntholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code lgtm, and running the tests locally works as described. I don't have maven, so some are ingored, as described.
Before the fix:
image
After the fix:
image

@b-fein b-fein added this to the 7.7.2 milestone Nov 24, 2024
@krusche krusche merged commit bcaf561 into develop Nov 24, 2024
32 of 36 checks passed
@krusche krusche deleted the bugfix/development/improve-template-integration-tests-on-linux branch November 24, 2024 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality programming Pull requests that affect the corresponding module ready to merge refactoring tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants