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

Iris: Fix server tests #7133

Merged
merged 9 commits into from
Sep 15, 2023
Merged

Iris: Fix server tests #7133

merged 9 commits into from
Sep 15, 2023

Conversation

Hialus
Copy link
Member

@Hialus Hialus commented Sep 1, 2023

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) database calls.
  • I followed the coding and design guidelines.
  • I added multiple integration tests (Spring) related to the features (with a high test coverage).
  • I added pre-authorization annotations according to the guidelines and checked the course groups for all new REST Calls (security).
  • I documented the Java code using JavaDoc style.

Motivation and Context

Currently on develop-iris the server tests are failing. Since it is a protected branch, the fixes are done here.

Description

Changes:

  • Moved the admin settings endpoint according to new rules
  • Removed unused methods in IrisMessageContentRepository
  • Fixed the error handling in IrisConnectorService::getOfferedModels
  • Added mocking of the /api/v1/models endpoint of Pyris
  • Added unit tests for the IrisConnectorService
  • Smaller fixes

Review Progress

Performance Review

  • I (as a reviewer) confirm that the client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance

Code Review

  • Code Review 1
  • Code Review 2

Test Coverage

Class/File Line Coverage Confirmation (assert/expect)
IrisAuthorizationInterceptor.java 100%
IrisConnectorService.java 91%
IrisWebsocketService.java 88%
AdminIrisSettingsResource.java 42%
IrisSettingsResource.java 96%

@Hialus Hialus self-assigned this Sep 1, 2023
@Hialus Hialus changed the base branch from develop to develop-iris September 1, 2023 08:43
@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) labels Sep 1, 2023
@Hialus Hialus marked this pull request as ready for review September 4, 2023 10:44
@Hialus Hialus requested a review from a team as a code owner September 4, 2023 10:44
@github-actions
Copy link

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

Copy link
Contributor

@DominikRemo DominikRemo left a comment

Choose a reason for hiding this comment

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

Looked through the tests
Left a question and a suggestion

Copy link
Contributor

@laadvo laadvo left a comment

Choose a reason for hiding this comment

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

I have two suggestions regarding the tests in IrisMessageIntegrationTest in general:

  1. You could consider using less users (instead of 14, I think 2 should suffice for all tests in userUtilService.addUsers(TEST_PREFIX, 14,..))
  2. There is a lot of duplicated code making the tests confuscated. You could consider extracting test setup into the @BeforeEach and other helper methods

# Conflicts:
#	src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java
@Hialus
Copy link
Member Author

Hialus commented Sep 14, 2023

I have two suggestions regarding the tests in IrisMessageIntegrationTest in general:

1. You could consider using less users (instead of 14, I think 2 should suffice for all tests in `userUtilService.addUsers(TEST_PREFIX, 14,..)`)

2. There is a lot of duplicated code making the tests confuscated. You could consider extracting test setup into the `@BeforeEach` and other helper methods
  1. True. This was older code and this is no longer needed. Thanks for noticing, I fixed it.
  2. I tried to reduce it a bit, but while the code is similar, it is not always the same, so further reducing wouldn't really be worth it imo.

@bassner bassner merged commit 0780c6b into develop-iris Sep 15, 2023
@bassner bassner deleted the bugfix/fix-iris-server-tests branch September 15, 2023 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Pull requests that update TypeScript code. (Added Automatically!) server Pull requests that update Java code. (Added Automatically!) tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants