Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feature/blackbox-t…
Browse files Browse the repository at this point in the history
…ests
  • Loading branch information
Christoph Knoedlseder committed Sep 14, 2023
2 parents aefa008 + dfe461c commit 0d3f18c
Show file tree
Hide file tree
Showing 30 changed files with 320 additions and 165 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,16 @@ jobs:
- name: Java Documentation
run: ./gradlew checkstyleMain -x webapp
if: success() || failure()
- name: Java Architecture Tests
run: ./gradlew test -DincludeTags='ArchitectureTest' -x webapp
if: success() || failure()
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Java Architecture Tests
path: build/test-results/test/*.xml
reporter: java-junit

client-tests:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ data-exports/
!/docker/.docker-data/artemis-data/.gitkeep
/docker/.docker-data/artemis-mysql-data/*
!/docker/.docker-data/artemis-mysql-data/.gitkeep
/docker/.docker-data/artemis-postgres-data/*
!/docker/.docker-data/artemis-postgres-data/.gitkeep

######################
# Cypress
Expand Down
13 changes: 10 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,17 @@ modernizer {
}

// Execute the test cases: ./gradlew test

// Execute only architecture tests: ./gradlew test -DincludeTags='ArchitectureTest'
test {
useJUnitPlatform()
exclude "**/*IT*", "**/*IntTest*"
if (System.getProperty("includeTags")) {
useJUnitPlatform {
includeTags System.getProperty("includeTags")
}
} else {
useJUnitPlatform()
exclude "**/*IT*", "**/*IntTest*"
}

testLogging {
events "FAILED", "SKIPPED"
}
Expand Down
Empty file.
7 changes: 2 additions & 5 deletions docker/artemis-dev-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ services:
# expose the port to make it reachable docker internally even if the external port mapping changes
expose:
- "5005"
environment:
# The following enables the Java Remote Debugging port. More infos in the documentation:
# https://ls1intum.github.io/Artemis/dev/setup.html#debugging-with-docker
_JAVA_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
SPRING_PROFILES_ACTIVE: artemis,scheduling,athena,dev,docker
env_file:
- ./artemis/config/dev.env
depends_on:
mysql:
condition: service_healthy
Expand Down
39 changes: 39 additions & 0 deletions docker/artemis-dev-postgres.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# ----------------------------------------------------------------------------------------------------------------------
# Artemis-Dev-Postgres Setup
# ----------------------------------------------------------------------------------------------------------------------

services:
artemis-app:
extends:
file: ./artemis.yml
service: artemis-app
# just add this linux workaround for docker compose in a development version of artemis as developers
# might want to access external services on the docker host
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "8080:8080"
- "5005:5005" # Java Remote Debugging port declared in the java cmd options
# expose the port to make it reachable docker internally even if the external port mapping changes
expose:
- "5005"
env_file:
- ./artemis/config/dev.env
- ./artemis/config/postgres.env
depends_on:
postgres:
condition: service_healthy
postgres:
extends:
file: ./postgres.yml
service: postgres

networks:
artemis:
driver: "bridge"
name: artemis
volumes:
artemis-postgres-data:
name: artemis-postgres-data
artemis-data:
name: artemis-data
10 changes: 6 additions & 4 deletions docker/artemis-migration-check-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ services:
file: ./artemis.yml
service: artemis-app
env_file:
- ./artemis/config/postgres.env
- ./artemis/config/cypress.env
- ./artemis/config/cypress-postgres.env
- ./artemis/config/migration-check.env
depends_on:
postgresql:
condition: service_healthy
postgresql:
extends:
file: ./postgresql.yml
service: postgresql
file: ./postgres.yml
service: postgres
migration-check:
image: alpine
container_name: migration-check
Expand All @@ -32,7 +34,7 @@ networks:
driver: "bridge"
name: artemis
volumes:
artemis-postgresql-data:
name: artemis-postgresql-data
artemis-postgres-data:
name: artemis-postgres-data
artemis-data:
name: artemis-data
38 changes: 38 additions & 0 deletions docker/artemis-prod-postgres.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# ----------------------------------------------------------------------------------------------------------------------
# Artemis-Prod-Postgres Setup
# ----------------------------------------------------------------------------------------------------------------------

services:
artemis-app:
extends:
file: ./artemis.yml
service: artemis-app
depends_on:
postgres:
condition: service_healthy
restart: on-failure:3
volumes:
- ./.docker-data/artemis-data:/opt/artemis/data
env_file:
- ./artemis/config/postgres.env
postgres:
extends:
file: ./postgres.yml
service: postgres
restart: on-failure:3
volumes:
- ./.docker-data/artemis-postgres-data:/var/lib/postgresql/data
nginx:
extends:
file: ./nginx.yml
service: nginx
# the artemis-app service needs to be started, otherwise there are problems with name resolution in docker
depends_on:
artemis-app:
condition: service_started
restart: on-failure:3

networks:
artemis:
driver: "bridge"
name: artemis
40 changes: 4 additions & 36 deletions docker/artemis/config/cypress-mysql.env
Original file line number Diff line number Diff line change
@@ -1,34 +1,21 @@
# ----------------------------------------------------------------------------------------------------------------------
# Artemis configuration overrides for the Cypress E2E MySQL setups
# ----------------------------------------------------------------------------------------------------------------------

SPRING_PROFILES_ACTIVE="artemis,scheduling,bamboo,bitbucket,jira,prod,docker"

SPRING_DATASOURCE_URL="jdbc:mysql://artemis-mysql:3306/Artemis?createDatabaseIfNotExist=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC"
SPRING_DATASOURCE_USERNAME="root"
SPRING_DATASOURCE_PASSWORD=""
SPRING_DATASOURCE_HIKARI_MAXIMUMPOOLSIZE="100"

SPRING_JPA_DATABASE_PLATFORM="org.hibernate.dialect.MySQL8Dialect"
SPRING_JPA_DATABASE="MYSQL"
SPRING_JPA_HIBERNATE_CONNECTION_CHARSET="utf8mb4"
SPRING_JPA_HIBERNATE_CONNECTION_CHARACTERENCODING="utf8mb4"
SPRING_JPA_HIBERNATE_CONNECTION_USEUNICODE="true"

SPRING_PROMETHEUS_MONITORINGIP="131.159.89.160"

# for bamboo and bitbucket notifications on /api/programming-exercises/new-result it seems like port
# 54321 is internally open for the bamboo agents
# also can't use SSL for this as the hostnames are not integrated in the self-signed certificate
SERVER_URL="http://${HOST_HOSTNAME}:54321"

# We don't need secure passwords for testing. Lower rounds will speed up tests. 4 is the lowest
ARTEMIS_BCRYPTSALTROUNDS="4"

ARTEMIS_USERMANAGEMENT_USEEXTERNAL="true"
ARTEMIS_USERMANAGEMENT_EXTERNAL_URL="https://jira-prelive.ase.in.tum.de"
ARTEMIS_USERMANAGEMENT_EXTERNAL_USER="${bamboo_jira_prelive_admin_user}"
ARTEMIS_USERMANAGEMENT_EXTERNAL_PASSWORD="${bamboo_jira_prelive_admin_password}"
ARTEMIS_USERMANAGEMENT_EXTERNAL_ADMINGROUPNAME="artemis-dev"
ARTEMIS_USERMANAGEMENT_INTERNALADMIN_USERNAME="${bamboo_artemis_admin_username}"
ARTEMIS_USERMANAGEMENT_INTERNALADMIN_PASSWORD="${bamboo_artemis_admin_password}"
ARTEMIS_USERMANAGEMENT_LOGIN_ACCOUNTNAME="TUM"

ARTEMIS_VERSIONCONTROL_URL="https://bitbucket-prelive.ase.in.tum.de"
ARTEMIS_VERSIONCONTROL_USER="${bamboo_jira_prelive_admin_user}"
Expand All @@ -40,22 +27,3 @@ ARTEMIS_CONTINUOUSINTEGRATION_PASSWORD="${bamboo_jira_prelive_admin_password}"
ARTEMIS_CONTINUOUSINTEGRATION_TOKEN="${bamboo_ARTEMIS_CONTINUOUS_INTEGRATION_TOKEN_SECRET}"
ARTEMIS_CONTINUOUSINTEGRATION_ARTEMISAUTHENTICATIONTOKENVALUE="${bamboo_ARTEMIS_CONTINUOUS_INTEGRATION_ARTEMIS_AUTHENTICATION_TOKEN_VALUE_SECRET}"
ARTEMIS_CONTINUOUSINTEGRATION_VCSAPPLICATIONLINKNAME="Bitbucket Prelive"
ARTEMIS_CONTINUOUSINTEGRATION_EMPTYCOMMITNECESSARY="true"

ARTEMIS_APOLLON_CONVERSIONSERVICEURL="https://apollon.ase.in.tum.de/api/converter"

# Token is valid 3 days
JHIPSTER_SECURITY_AUTHENTICATION_JWT_TOKENVALIDITYINSECONDS="259200"
# Token is valid 30 days
JHIPSTER_SECURITY_AUTHENTICATION_JWT_TOKENVALIDITYINSECONDSFORREMEMBERME="2592000"

# Properties to be exposed on the /info management endpoint

INFO_IMPRINT="https://ase.in.tum.de/lehrstuhl_1/component/content/article/179-imprint"
INFO_TESTSERVER="true"
INFO_TEXTASSESSMENTANALYTICSENABLED="true"
INFO_STUDENTEXAMSTORESESSIONDATA="true"

LOGGING_FILE_NAME="/opt/artemis/data/artemis.log"

MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED="true"
45 changes: 1 addition & 44 deletions docker/artemis/config/cypress-postgres.env
Original file line number Diff line number Diff line change
@@ -1,34 +1,10 @@
# ----------------------------------------------------------------------------------------------------------------------
# Artemis configurations for Postgres setups
# Artemis configuration overrides for the Cypress E2E Postgres setups
# ----------------------------------------------------------------------------------------------------------------------

SPRING_PROFILES_ACTIVE="artemis,scheduling,jenkins,gitlab,prod,docker"

SPRING_DATASOURCE_URL="jdbc:postgresql://artemis-postgresql:5432/Artemis?sslmode=disable"
SPRING_DATASOURCE_USERNAME="postgres"
SPRING_DATASOURCE_PASSWORD=""
SPRING_DATASOURCE_HIKARI_MAXIMUMPOOLSIZE="100"

SPRING_JPA_DATABASE_PLATFORM="org.hibernate.dialect.PostgreSQL10Dialect"
SPRING_JPA_DATABASE="POSTGRESQL"
SPRING_JPA_HIBERNATE_CONNECTION_CHARSET="utf8mb4"
SPRING_JPA_HIBERNATE_CONNECTION_CHARACTERENCODING="utf8mb4"
SPRING_JPA_HIBERNATE_CONNECTION_USEUNICODE="true"

SPRING_PROMETHEUS_MONITORINGIP="131.159.89.160"

# for bamboo and bitbucket notifications on /api/programming-exercises/new-result it seems like port
# 54321 is internally open for the bamboo agents
# also can't use SSL for this as the hostnames are not integrated in the self-signed certificate
SERVER_URL="http://${HOST_HOSTNAME}:54321"

# We don't need secure passwords for testing. Lower rounds will speed up tests. 4 is the lowest
ARTEMIS_BCRYPTSALTROUNDS="4"

ARTEMIS_USERMANAGEMENT_USEEXTERNAL="false"
ARTEMIS_USERMANAGEMENT_INTERNALADMIN_USERNAME="${bamboo_artemis_admin_username}"
ARTEMIS_USERMANAGEMENT_INTERNALADMIN_PASSWORD="${bamboo_artemis_admin_password}"
ARTEMIS_USERMANAGEMENT_LOGIN_ACCOUNTNAME="TUM"

ARTEMIS_VERSIONCONTROL_URL="https://gitlab-test.artemis.in.tum.de"
ARTEMIS_VERSIONCONTROL_USER="${bamboo_gitlab_admin_user}"
Expand All @@ -44,26 +20,7 @@ ARTEMIS_CONTINUOUSINTEGRATION_SECRETPUSHTOKEN="${bamboo_jenkins_secret_push_toke
ARTEMIS_CONTINUOUSINTEGRATION_VCSCREDENTIALS="${bamboo_jenkins_vcs_credentials_secret}"
ARTEMIS_CONTINUOUSINTEGRATION_ARTEMISAUTHENTICATIONTOKENKEY="${bamboo_jenkins_artemis_ci_authentication_token_key_secret}"
ARTEMIS_CONTINUOUSINTEGRATION_ARTEMISAUTHENTICATIONTOKENVALUE="${bamboo_jenkins_artemis_ci_authentication_token_value_secret}"
ARTEMIS_CONTINUOUSINTEGRATION_EMPTYCOMMITNECESSARY="true"
ARTEMIS_CONTINUOUSINTEGRATION_BUILDTIMEOUT="30"

ARTEMIS_APOLLON_CONVERSIONSERVICEURL="https://apollon.ase.in.tum.de/api/converter"

# Token is valid 3 days
JHIPSTER_SECURITY_AUTHENTICATION_JWT_TOKENVALIDITYINSECONDS="259200"
# Token is valid 30 days
JHIPSTER_SECURITY_AUTHENTICATION_JWT_TOKENVALIDITYINSECONDSFORREMEMBERME="2592000"

# Properties to be exposed on the /info management endpoint

INFO_IMPRINT="https://ase.in.tum.de/lehrstuhl_1/component/content/article/179-imprint"
INFO_TESTSERVER="true"
INFO_TEXTASSESSMENTANALYTICSENABLED="true"
INFO_STUDENTEXAMSTORESESSIONDATA="true"

LOGGING_FILE_NAME="/opt/artemis/data/artemis.log"

MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED="true"

JENKINS_INTERNALURLS_CIURL="https://jenkins-test.artemis.in.tum.de"
JENKINS_INTERNALURLS_VCNURL="https://gitlab-test.artemis.in.tum.de"
44 changes: 44 additions & 0 deletions docker/artemis/config/cypress.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# ----------------------------------------------------------------------------------------------------------------------
# Common Artemis configurations for the Cypress E2E MySQL and Postgres setups
# ----------------------------------------------------------------------------------------------------------------------

SPRING_DATASOURCE_PASSWORD=""
SPRING_DATASOURCE_HIKARI_MAXIMUMPOOLSIZE="100"

SPRING_JPA_HIBERNATE_CONNECTION_CHARSET="utf8mb4"
SPRING_JPA_HIBERNATE_CONNECTION_CHARACTERENCODING="utf8mb4"
SPRING_JPA_HIBERNATE_CONNECTION_USEUNICODE="true"

SPRING_PROMETHEUS_MONITORINGIP="131.159.89.160"

# for bamboo and bitbucket notifications on /api/programming-exercises/new-result it seems like port
# 54321 is internally open for the bamboo agents
# also can't use SSL for this as the hostnames are not integrated in the self-signed certificate
SERVER_URL="http://${HOST_HOSTNAME}:54321"

# We don't need secure passwords for testing. Lower rounds will speed up tests. 4 is the lowest
ARTEMIS_BCRYPTSALTROUNDS="4"

ARTEMIS_USERMANAGEMENT_INTERNALADMIN_USERNAME="${bamboo_artemis_admin_username}"
ARTEMIS_USERMANAGEMENT_INTERNALADMIN_PASSWORD="${bamboo_artemis_admin_password}"
ARTEMIS_USERMANAGEMENT_LOGIN_ACCOUNTNAME="TUM"

ARTEMIS_CONTINUOUSINTEGRATION_EMPTYCOMMITNECESSARY="true"

ARTEMIS_APOLLON_CONVERSIONSERVICEURL="https://apollon.ase.in.tum.de/api/converter"

# Token is valid 3 days
JHIPSTER_SECURITY_AUTHENTICATION_JWT_TOKENVALIDITYINSECONDS="259200"
# Token is valid 30 days
JHIPSTER_SECURITY_AUTHENTICATION_JWT_TOKENVALIDITYINSECONDSFORREMEMBERME="2592000"

# Properties to be exposed on the /info management endpoint

INFO_IMPRINT="https://ase.in.tum.de/lehrstuhl_1/component/content/article/179-imprint"
INFO_TESTSERVER="true"
INFO_TEXTASSESSMENTANALYTICSENABLED="true"
INFO_STUDENTEXAMSTORESESSIONDATA="true"

LOGGING_FILE_NAME="/opt/artemis/data/artemis.log"

MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED="true"
11 changes: 11 additions & 0 deletions docker/artemis/config/dev.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ----------------------------------------------------------------------------------------------------------------------
# Artemis configurations for Dev Artemis setups
# ----------------------------------------------------------------------------------------------------------------------
# The default Artemis Spring profiles for Docker are defined here.
# ----------------------------------------------------------------------------------------------------------------------

SPRING_PROFILES_ACTIVE: artemis,scheduling,athena,dev,docker

# The following enables the Java Remote Debugging port. More infos in the documentation:
# https://ls1intum.github.io/Artemis/dev/setup.html#debugging-with-docker
_JAVA_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
9 changes: 9 additions & 0 deletions docker/artemis/config/postgres.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ----------------------------------------------------------------------------------------------------------------------
# Artemis configurations for Postgres setups
# ----------------------------------------------------------------------------------------------------------------------

SPRING_DATASOURCE_URL="jdbc:postgresql://artemis-postgres:5432/Artemis?sslmode=disable"
SPRING_DATASOURCE_USERNAME="postgres"

SPRING_JPA_DATABASE_PLATFORM="org.hibernate.dialect.PostgreSQL10Dialect"
SPRING_JPA_DATABASE="POSTGRESQL"
15 changes: 14 additions & 1 deletion docker/artemis/config/prod.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# ----------------------------------------------------------------------------------------------------------------------
# Artemis configurations for Prod Artemis setups
# ----------------------------------------------------------------------------------------------------------------------
# The default Artemis Spring profiles for Docker are defined here.
# ----------------------------------------------------------------------------------------------------------------------
SPRING_PROFILES_ACTIVE="artemis,scheduling,athena,prod,docker"

# ----------------------------------------------------------------------------------------------------------------------
# Secret Overrides
# ----------------------------------------------------------------------------------------------------------------------
# Change these default secrets in another not-commited environment override file for prod systems!
# ----------------------------------------------------------------------------------------------------------------------
ARTEMIS_ATHENA_SECRET="abcdefg12345"
ARTEMIS_USERMANAGEMENT_INTERNALADMIN_USERNAME="artemis_admin"
ARTEMIS_USERMANAGEMENT_INTERNALADMIN_PASSWORD="artemis_admin"
Expand All @@ -17,6 +26,10 @@ SPRING_WEBSOCKET_BROKER_PASSWORD="guest"
JHIPSTER_SECURITY_AUTHENTICATION_JWT_BASE64SECRET="bXktc2VjcmV0LWtleS13aGljaC1zaG91bGQtYmUtY2hhbmdlZC1pbi1wcm9kdWN0aW9uLWFuZC1iZS1iYXNlNjQtZW5jb2RlZAo="
JHIPSTER_REGISTRY_PASSWORD="AN-ADMIN-PASSWORD-THAT-MUST-BE-CHANGED (FROM REGISTRY CONFIG)"


# ----------------------------------------------------------------------------------------------------------------------
# Plain Prod Artemis Overrides
# ----------------------------------------------------------------------------------------------------------------------
# Keep these at a minimum! Try to change the default values either in the application-docker.yml or even better
# in one of the other application.yml or application-*.yml files.
# ----------------------------------------------------------------------------------------------------------------------
ARTEMIS_USERMANAGEMENT_USEEXTERNAL="false"
Loading

0 comments on commit 0d3f18c

Please sign in to comment.