Skip to content

Commit

Permalink
Merge branch 'develop' into bugfix/integrated-code-lifecycle/re-init
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/de/tum/cit/aet/artemis/buildagent/service/BuildJobExecutionService.java
  • Loading branch information
BBesrour committed Dec 11, 2024
2 parents 8816eee + da468e2 commit c38e88b
Show file tree
Hide file tree
Showing 208 changed files with 4,399 additions and 1,280 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Refer to [Using JHipster in production](http://www.jhipster.tech/production) for
The following command can automate the deployment to a server. The example shows the deployment to the main Artemis test server (which runs a virtual machine):

```shell
./artemis-server-cli deploy [email protected] -w build/libs/Artemis-7.7.4.war
./artemis-server-cli deploy [email protected] -w build/libs/Artemis-7.7.5.war
```

## Architecture
Expand Down
19 changes: 8 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ plugins {
}

group = "de.tum.cit.aet.artemis"
version = "7.7.4"
version = "7.7.5"
description = "Interactive Learning with Individual Feedback"

java {
Expand Down Expand Up @@ -80,7 +80,7 @@ spotless {
}
}
importOrderFile "artemis-spotless.importorder"
eclipse("4.28").configFile "artemis-spotless-style.xml"
eclipse("4.33").configFile "artemis-spotless-style.xml"

removeUnusedImports()
trimTrailingWhitespace()
Expand Down Expand Up @@ -135,8 +135,8 @@ test {
}
testLogging.showStandardStreams = true
reports.html.required = false
minHeapSize = "1024m" // initial heap size
maxHeapSize = "3072m" // maximum heap size
minHeapSize = "2g" // initial heap size
maxHeapSize = "8g" // maximum heap size
}

tasks.register("testReport", TestReport) {
Expand Down Expand Up @@ -215,9 +215,6 @@ repositories {
}
}

ext["jackson.version"] = fasterxml_version
ext["junit-jupiter.version"] = junit_version

dependencies {

// Note: jenkins-client is not well maintained and includes dependencies to libraries with critical security issues (e.g. CVE-2020-10683 for [email protected])
Expand Down Expand Up @@ -260,7 +257,7 @@ dependencies {
implementation "org.apache.lucene:lucene-queryparser:${lucene_version}"
implementation "org.apache.lucene:lucene-core:${lucene_version}"
implementation "org.apache.lucene:lucene-analyzers-common:${lucene_version}"
implementation "com.google.protobuf:protobuf-java:4.29.0"
implementation "com.google.protobuf:protobuf-java:4.29.1"

// we have to override those values to use the latest version
implementation "org.slf4j:jcl-over-slf4j:${slf4j_version}"
Expand Down Expand Up @@ -540,8 +537,8 @@ dependencies {
exclude module: "android-json"
}

// cannot update due to "Syntax error in SQL statement "WITH ids_to_delete"
// testImplementation "com.h2database:h2:2.3.230"
// NOTE: cannot update due to "Syntax error in SQL statement "WITH ids_to_delete" --> should be resolved when we collapse the changelogs again for Artemis 8.0
// testImplementation "com.h2database:h2:2.3.232"
testImplementation "com.h2database:h2:2.2.224"

// Lightweight JSON library needed for the internals of the MockRestServiceServer
Expand All @@ -553,7 +550,7 @@ dependencies {

dependencyManagement {
imports {
mavenBom "io.zonky.test.postgres:embedded-postgres-binaries-bom:17.0.0"
mavenBom "io.zonky.test.postgres:embedded-postgres-binaries-bom:17.2.0"
}
}

Expand Down
47 changes: 34 additions & 13 deletions docs/dev/playwright.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ Set up Playwright locally
To run the tests locally, developers need to set up Playwright on their machines.
End-to-end tests test entire workflows; therefore, they require the whole Artemis setup - database, client, and server to be running.
Playwright tests rely on the Playwright Node.js library, browser binaries, and some helper packages.
To run playwright tests locally, you need to start the Artemis server and client, have the correct users set up and install and run playwright.
This setup should be used for debugging, and creating new tests for your code, but needs intellij to work, and relies on fully setting up your local Artemis instance
following :ref:`the server setup guide<dev_setup>`.


For a quick test setup with only three steps, you can use the scripts provided in `supportingScripts/playwright`.
The README explains what you need to do.
It sets up Artemis inside a dockerized environment, creates users and directly starts playwright. The main drawback with this setup is, that you cannot
easily change the version of Artemis itself.


If you want to manually install playwright, you can follow these steps:

1. Install dependencies:

Expand All @@ -29,40 +41,49 @@ Playwright tests rely on the Playwright Node.js library, browser binaries, and s

.. code-block:: text
PLAYWRIGHT_USERNAME_TEMPLATE=artemis_test_user_USERID
PLAYWRIGHT_PASSWORD_TEMPLATE=artemis_test_user_USERID
PLAYWRIGHT_USERNAME_TEMPLATE=artemis_test_user_
PLAYWRIGHT_PASSWORD_TEMPLATE=artemis_test_user_
ADMIN_USERNAME=artemis_admin
ADMIN_PASSWORD=artemis_admin
ALLOW_GROUP_CUSTOMIZATION=true
STUDENT_GROUP_NAME=students
TUTOR_GROUP_NAME=tutors
EDITOR_GROUP_NAME=editors
INSTRUCTOR_GROUP_NAME=instructors
CREATE_USERS=true
BASE_URL=http://localhost:9000
EXERCISE_REPO_DIRECTORY=test-exercise-repos
FAST_TEST_TIMEOUT_SECONDS=45
SLOW_TEST_TIMEOUT_SECONDS=180
Make sure ``BASE_URL`` matches your Artemis client URL and ``ADMIN_USERNAME`` and
``ADMIN_PASSWORD`` match your Artemis admin user credentials.

3. Configure test users

Playwright tests require users with different roles to simulate concurrent user interactions. You can configure
user IDs and check their corresponding user roles in the ``src/test/playwright/support/users.ts`` file. Usernames
are defined automatically by replacing the ``USERID`` part in ``PLAYWRIGHT_USERNAME_TEMPLATE`` with the
corresponding user ID. If users with such usernames do not exist, set ``CREATE_USERS`` to ``true`` on the
``playwright.env`` file for users to be created during the setup stage. If users with the same usernames but
different user roles already exist, change the user IDs to different values to ensure that new users are created
with roles defined in the configuration.
Playwright tests require users with different roles to simulate concurrent user interactions. If you already
have generated test users, you can skip this step. Generate users with the help of the user creation scripts under the
`supportingScripts/playwright` folder:

.. code-block:: bash
setupUsers.sh
You can configure user IDs and check their corresponding user roles in the ``src/test/playwright/support/users.ts`` file.
Usernames are defined automatically by appending the userId to the ``PLAYWRIGHT_USERNAME_TEMPLATE``.
At the moment it is discouraged to change the template string, as the user creation script does not support other names yet.

4. Setup Playwright package and its browser binaries:

Install Playwright browser binaries, set up the environment to ensure Playwright can locate these binaries, and
create test users (if creating users is enabled in the configuration) with the following command:
Install Playwright browser binaries, set up the environment to ensure Playwright can locate these binaries.
On some operating systems this might not work, and playwright needs to be manually installed via a package manager.

.. code-block:: bash
npm run playwright:setup
npm run playwright:setup-local
npm run playwright:init
5. Open Playwright UI

Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spring_boot_version=3.4.0
spring_framework_version=6.2.0
spring_cloud_version=4.2.0
spring_security_version=6.4.1
# TODO: upgrading to 6.6.0 currently leads to issues due to internal changes in Hibernate and potentially wrong use in Artemis server code
# TODO: upgrading to 6.6.x currently leads to issues due to internal changes in Hibernate and potentially wrong use in Artemis server code
hibernate_version=6.4.10.Final
# TODO: can we update to 5.x?
opensaml_version=4.3.2
Expand All @@ -23,8 +23,8 @@ jgit_version=7.1.0.202411261347-r
sshd_version=2.14.0
checkstyle_version=10.20.2
jplag_version=5.1.0
# not really used in Artemis, nor Jplag, nor the used version of Stanford CoreNLP, but we use the latest to avoid security vulnerabilities
# NOTE: we do not need to use the latest version 9.x here as long as Stanford CoreNLP does not reference it
# not really used in Artemis, nor JPlag, nor the used version of Stanford CoreNLP, but we use the latest to avoid security vulnerability warnings
# NOTE: we cannot need to use the latest version 9.x or 10.x here as long as Stanford CoreNLP does not reference it
lucene_version=8.11.4
slf4j_version=2.0.16
sentry_version=7.18.1
Expand All @@ -49,7 +49,7 @@ apt_plugin_version=0.21
liquibase_plugin_version=2.1.1
modernizer_plugin_version=1.10.0

org.gradle.jvmargs=-Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en \
org.gradle.jvmargs=-Xmx2g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en \
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ module.exports = {
},
],
},
modulePathIgnorePatterns: ['<rootDir>/src/main/resources/templates/'],
modulePathIgnorePatterns: ['<rootDir>/src/main/resources/templates/', '<rootDir>/build/'],
testTimeout: 3000,
testMatch: [
'<rootDir>/src/test/javascript/spec/component/**/*.spec.ts',
Expand Down
36 changes: 18 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "artemis",
"version": "7.7.4",
"version": "7.7.5",
"description": "Interactive Learning with Individual Feedback",
"private": true,
"license": "MIT",
Expand Down Expand Up @@ -68,7 +68,7 @@
"ngx-webstorage": "18.0.0",
"papaparse": "5.4.1",
"pdf-lib": "1.17.1",
"pdfjs-dist": "4.9.124",
"pdfjs-dist": "4.9.155",
"rxjs": "7.8.1",
"simple-statistics": "7.8.7",
"smoothscroll-polyfill": "0.4.4",
Expand Down Expand Up @@ -154,13 +154,13 @@
"jest-extended": "4.0.2",
"jest-fail-on-console": "3.3.1",
"jest-junit": "16.0.0",
"jest-preset-angular": "14.4.1",
"jest-preset-angular": "14.4.2",
"lint-staged": "15.2.10",
"ngxtension": "4.1.0",
"ng-mocks": "14.13.1",
"prettier": "3.4.1",
"prettier": "3.4.2",
"rimraf": "6.0.1",
"sass": "1.81.0",
"sass": "1.82.0",
"ts-jest": "29.2.5",
"typescript": "5.5.4",
"weak-napi": "2.0.2"
Expand Down
4 changes: 1 addition & 3 deletions ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ http://pmd.sourceforge.net/ruleset/2.0.0 ">

<rule ref="category/java/codestyle.xml/MethodNamingConventions">
<description>
Allows underscores in JUnit 4 and 5 test methods
Allows underscores in JUnit 5 test methods
Template from https://pmd.github.io/pmd-6.40.0/pmd_userdocs_making_rulesets.html#creating-a-ruleset
</description>
<properties>
<property name="methodPattern" value="[a-z][a-zA-Z0-9]*"/>
<property name="staticPattern" value="[a-z][a-zA-Z0-9]*"/>
<property name="nativePattern" value="[a-z][a-zA-Z0-9]*"/>
<property name="junit3TestPattern" value="test[A-Z0-9][a-zA-Z0-9]*"/>
<property name="junit4TestPattern" value="[a-z][a-zA-Z0-9_]*"/>
<property name="junit5TestPattern" value="[a-z][a-zA-Z0-9_]*"/>
</properties>
</rule>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ default List<Result> findLatestAutomaticResultsWithEagerFeedbacksTestCasesForExe

Optional<Result> findFirstByParticipationIdOrderByCompletionDateDesc(long participationId);

Optional<Result> findFirstByParticipationIdAndAssessmentTypeOrderByCompletionDateDesc(long participationId, AssessmentType assessmentType);

@EntityGraph(type = LOAD, attributePaths = { "feedbacks", "feedbacks.testCase" })
Optional<Result> findResultWithFeedbacksAndTestCasesById(long resultId);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package de.tum.cit.aet.artemis.athena.dto;

import java.util.List;

import jakarta.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonInclude;
Expand All @@ -13,7 +11,7 @@
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public record ModelingFeedbackDTO(long id, long exerciseId, long submissionId, String title, String description, double credits, Long structuredGradingInstructionId,
List<String> elementIds) implements FeedbackBaseDTO {
String reference) implements FeedbackBaseDTO {

/**
* Creates a ModelingFeedbackDTO from a Feedback object
Expand All @@ -30,6 +28,6 @@ public static ModelingFeedbackDTO of(long exerciseId, long submissionId, @NotNul
}

return new ModelingFeedbackDTO(feedback.getId(), exerciseId, submissionId, feedback.getText(), feedback.getDetailText(), feedback.getCredits(), gradingInstructionId,
List.of(feedback.getReference()));
feedback.getReference());
}
}
Loading

0 comments on commit c38e88b

Please sign in to comment.