Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into chore/exercise-gro…
Browse files Browse the repository at this point in the history
…ups-client-migration
  • Loading branch information
coolchock committed Dec 10, 2024
2 parents 144b991 + 037d35d commit 9fb875e
Show file tree
Hide file tree
Showing 295 changed files with 5,473 additions and 5,377 deletions.
117 changes: 0 additions & 117 deletions .github/workflows/analysis-of-endpoint-connections.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,3 @@ data-exports/
# Supporting scripts config
##############################
/supporting_scripts/**/*.ini
/supporting_scripts/analysis-of-endpoint-connections/build/**/*
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
45 changes: 16 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ plugins {
id "com.github.ben-manes.versions" version "0.51.0"
id "com.github.andygoossens.modernizer" version "${modernizer_plugin_version}"
id "com.gorylenko.gradle-git-properties" version "2.4.2"
id "org.owasp.dependencycheck" version "11.1.0"
id "org.owasp.dependencycheck" version "11.1.1"
id "com.adarshr.test-logger" version "4.0.0"
}

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 All @@ -96,9 +96,10 @@ spotless {
@Override
String apply(String s, File file) throws Exception {
if (s =~ /\nimport .*\*;/) {
throw new AssertionError("Do not use wildcard imports. spotlessApply cannot resolve this issue.\n" +
throw new IllegalArgumentException("Do not use wildcard imports. spotlessApply cannot resolve this issue.\n" +
"The following file violates this rule: " + file.getName())
}
return s // Ensure a value is returned after processing
}
}))
}
Expand Down Expand Up @@ -134,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 @@ -180,13 +181,13 @@ jacocoTestCoverageVerification {
counter = "INSTRUCTION"
value = "COVEREDRATIO"
// TODO: in the future the following value should become higher than 0.92
minimum = 0.893
minimum = 0.892
}
limit {
counter = "CLASS"
value = "MISSEDCOUNT"
// TODO: in the future the following value should become less than 10
maximum = 64
maximum = 65
}
}
}
Expand All @@ -212,18 +213,8 @@ repositories {
maven {
url "https://build.shibboleth.net/maven/releases"
}
// TODO: remove this when spring cloud is available in the official maven repository
maven {
url "https://repo.spring.io/milestone"
}
}

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

ext { qDoxVersionReusable = "com.thoughtworks.qdox:qdox:2.2.0" }
ext { springBootStarterWeb = "org.springframework.boot:spring-boot-starter-web:${spring_boot_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 @@ -266,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 @@ -297,7 +288,7 @@ dependencies {
implementation "org.apache.sshd:sshd-sftp:${sshd_version}"

// https://mvnrepository.com/artifact/net.sourceforge.plantuml/plantuml
implementation "net.sourceforge.plantuml:plantuml:1.2024.7"
implementation "net.sourceforge.plantuml:plantuml:1.2024.8"
implementation "org.jasypt:jasypt:1.9.3"
implementation "me.xdrop:fuzzywuzzy:1.4.0"
implementation("org.yaml:snakeyaml") {
Expand All @@ -307,7 +298,7 @@ dependencies {
}
}

implementation qDoxVersionReusable
implementation "com.thoughtworks.qdox:qdox:2.2.0"
implementation "io.sentry:sentry-logback:${sentry_version}"
implementation "io.sentry:sentry-spring-boot-starter-jakarta:${sentry_version}"

Expand All @@ -328,10 +319,6 @@ dependencies {
implementation "org.jsoup:jsoup:1.18.3"
implementation "commons-codec:commons-codec:1.17.1" // needed for spring security saml2

// TODO: decide if we want to use OpenAPI and Swagger v3
// implementation 'io.swagger.core.v3:swagger-annotations:2.2.23'
// implementation "org.springdoc:springdoc-openapi-ui:1.8.0"

// use the latest version to avoid security vulnerabilities
implementation "org.springframework:spring-webmvc:${spring_framework_version}"

Expand Down Expand Up @@ -393,7 +380,7 @@ dependencies {
implementation "org.springframework.boot:spring-boot-starter-aop:${spring_boot_version}"
implementation "org.springframework.boot:spring-boot-starter-data-jpa:${spring_boot_version}"
implementation "org.springframework.boot:spring-boot-starter-security:${spring_boot_version}"
implementation(springBootStarterWeb) {
implementation("org.springframework.boot:spring-boot-starter-web:${spring_boot_version}") {
exclude module: "spring-boot-starter-undertow"
}
implementation "org.springframework.boot:spring-boot-starter-tomcat:${spring_boot_version}"
Expand Down Expand Up @@ -550,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 @@ -563,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
Loading

0 comments on commit 9fb875e

Please sign in to comment.