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: Extend exam user tests #8367

Conversation

julian-christl
Copy link
Member

@julian-christl julian-christl commented Apr 10, 2024

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) database calls.
  • I strictly followed the server coding and design guidelines.

Motivation and Context

#8207 exposed gaps in the exam user test.

Description

For the exam user image upload and the signature collection I added the use cases to update the corresponding files.
To do this, I reactivated and fixed a recently deactivated test. Additionally, I found out that the one issue we found in the PR did also occur for the exam user images, hence I fixed this issue.

Exam Mode Testing

Upload the images for the exam user twice, make sure nothing changes, and all images are where they belong after the second upload.

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked







Review Progress

Performance Review

  • 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

Exam Mode Test

  • Test 1

Test Coverage

Class/File Line Coverage Confirmation (assert/expect)
ExamUserRessource.java 100%

@julian-christl julian-christl self-assigned this Apr 10, 2024
@julian-christl julian-christl requested a review from a team as a code owner April 10, 2024 13:36
@julian-christl julian-christl linked an issue Apr 10, 2024 that may be closed by this pull request
Copy link

coderabbitai bot commented Apr 10, 2024

Walkthrough

This update introduces efficient data retrieval methods for programming exercises, refines image handling in exam services, and enhances testing frameworks for exam functionalities. It aims to optimize performance, improve testing coverage, and ensure functionality correctness across various components of the Artemis platform.

Changes

File Path Change Summary
.../ProgrammingExerciseRepository.java
.../ProgrammingExerciseTestRepository.java
Added method to efficiently load exercises with specific participations using EntityGraph.
.../ExamUserService.java Updated image path handling in the saveImages method.
.../ExamUserIntegrationTest.java Enabled and refined tests for exam user functionalities, including attendance verification.
.../ProgrammingExerciseTestService.java Refactored setup logic for programming exercises in exams, improved test setup.

Possibly related issues


Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 5869fc9 and 0712407.
Files selected for processing (2)
  • src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseTestService.java (3 hunks)
  • src/test/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseTestRepository.java (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseTestService.java
Additional Context Used
Path-based Instructions (1)
src/test/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseTestRepository.java (1)

Pattern src/test/java/**/*.java: test_naming: descriptive; test_size: small_specific; fixed_data: true; junit5_features: true; assert_use: assertThat; assert_specificity: true; archunit_use: enforce_package_rules; db_query_count_tests: track_performance; util_service_factory_pattern: true; avoid_db_access: true; mock_strategy: static_mocks; context_restart_minimize: true

Additional comments not posted (3)
src/test/java/de/tum/in/www1/artemis/repository/ProgrammingExerciseTestRepository.java (3)

76-77: The implementation of findAllWithTemplateAndSolutionParticipationByIdIn using EntityGraph for optimized fetching of template and solution participations is well-designed and adheres to performance best practices.


9-9: The import of EntityGraph is correctly placed and necessary for the annotations used in the repository.


3-3: The import of LOAD from EntityGraph.EntityGraphType is appropriate and necessary for specifying the fetch type in the EntityGraph annotation.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) labels Apr 10, 2024
coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 10, 2024
nityanandaz
nityanandaz previously approved these changes Apr 10, 2024
Copy link
Contributor

@nityanandaz nityanandaz left a comment

Choose a reason for hiding this comment

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

Manual test (local): Could upload successfully exam user images via PDF multiple times

Copy link
Contributor

@MaximilianAnzinger MaximilianAnzinger left a comment

Choose a reason for hiding this comment

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

Maintainer approved 👍

Strohgelaender
Strohgelaender previously approved these changes Apr 10, 2024
@julian-christl julian-christl added the maintainer-approved The feature maintainer has approved the PR label Apr 10, 2024
Copy link
Member

@krusche krusche left a comment

Choose a reason for hiding this comment

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

Code looks good

@krusche krusche merged commit 816bc5e into develop Apr 10, 2024
23 of 27 checks passed
@krusche krusche deleted the tests/8289-enable-examuserintegrationtest-testverifyexamuserattendance branch April 10, 2024 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer-approved The feature maintainer has approved the PR server Pull requests that update Java code. (Added Automatically!) small tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Enable ExamUserIntegrationTest > testVerifyExamUserAttendance
5 participants