Skip to content

Commit

Permalink
Merge branch 'feature/summary-on-exam-deletion' into feature/summary-…
Browse files Browse the repository at this point in the history
…course-deletion
  • Loading branch information
ole-ve authored Sep 7, 2024
2 parents 400071b + d706989 commit 035f15a
Show file tree
Hide file tree
Showing 1,656 changed files with 20,288 additions and 31,097 deletions.
4 changes: 0 additions & 4 deletions .ci/E2E-tests/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@ docker container stop $(docker ps -a -q) || true
docker container rm $(docker ps -a -q) || true
docker volume rm $(docker volume ls -q) || true

docker compose -f ./docker/cypress-E2E-tests-mysql.yml down -v
docker compose -f ./docker/cypress-E2E-tests-postgres.yml down -v
docker compose -f ./docker/playwright-E2E-tests-mysql.yml down -v
docker compose -f ./docker/cypress-E2E-tests-local.yml down -v
docker compose -f ./docker/playwright-E2E-tests-multi-node.yml down -v
docker compose -f ./docker/cypress-E2E-tests-multi-node.yml down -v

# show all running docker containers and volumes after the cleanup to detect issues
echo "SHOW RUNNING Docker containers and volumes:"
Expand Down
37 changes: 3 additions & 34 deletions .ci/E2E-tests/execute.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ DB="mysql"

echo "CONFIGURATION:"
echo "$CONFIGURATION"
echo "Test framework:"
echo "$TEST_FRAMEWORK"

if [ "$TEST_FRAMEWORK" = "playwright" ]; then
if [ "$CONFIGURATION" = "mysql" ]; then
if [ "$CONFIGURATION" = "mysql" ]; then
COMPOSE_FILE="playwright-E2E-tests-mysql.yml"
elif [ "$CONFIGURATION" = "postgres" ]; then
COMPOSE_FILE="playwright-E2E-tests-postgres.yml"
Expand All @@ -22,21 +19,6 @@ if [ "$TEST_FRAMEWORK" = "playwright" ]; then
else
echo "Invalid configuration. Please choose among mysql, postgres, mysql-localci or multi-node."
exit 1
fi
else
if [ "$CONFIGURATION" = "mysql" ]; then
COMPOSE_FILE="cypress-E2E-tests-mysql.yml"
elif [ "$CONFIGURATION" = "postgres" ]; then
COMPOSE_FILE="cypress-E2E-tests-postgres.yml"
DB="postgres"
elif [ "$CONFIGURATION" = "local" ]; then
COMPOSE_FILE="cypress-E2E-tests-local.yml"
elif [ "$CONFIGURATION" = "multi-node" ]; then
COMPOSE_FILE="cypress-E2E-tests-multi-node.yml"
else
echo "Invalid configuration. Please choose among mysql, postgres, local or multi-node."
exit 1
fi
fi

echo "Compose file:"
Expand All @@ -51,8 +33,7 @@ export HOST_HOSTNAME=$(hostname)

cd docker
#just pull everything else than artemis-app as we build it later either way
if [ "$TEST_FRAMEWORK" = "playwright" ]; then
if [ "$CONFIGURATION" = "multi-node" ]; then
if [ "$CONFIGURATION" = "multi-node" ]; then
echo "Building for playwright (multi-node)"
docker compose -f $COMPOSE_FILE pull artemis-playwright $DB nginx
docker compose -f $COMPOSE_FILE build --build-arg WAR_FILE_STAGE=external_builder --no-cache --pull artemis-app-node-1 artemis-app-node-2 artemis-app-node-3
Expand All @@ -62,20 +43,8 @@ if [ "$TEST_FRAMEWORK" = "playwright" ]; then
docker compose -f $COMPOSE_FILE pull artemis-playwright $DB nginx
docker compose -f $COMPOSE_FILE build --build-arg WAR_FILE_STAGE=external_builder --no-cache --pull artemis-app
docker compose -f $COMPOSE_FILE up --exit-code-from artemis-playwright
fi
else
if [ "$CONFIGURATION" = "multi-node" ]; then
echo "Building for cypress (multi-node)"
docker compose -f $COMPOSE_FILE pull artemis-cypress $DB nginx
docker compose -f $COMPOSE_FILE build --build-arg WAR_FILE_STAGE=external_builder --no-cache --pull artemis-app-node-1 artemis-app-node-2 artemis-app-node-3
docker compose -f $COMPOSE_FILE up --exit-code-from artemis-cypress
else
echo "Building for cypress"
docker compose -f $COMPOSE_FILE pull artemis-cypress $DB nginx
docker compose -f $COMPOSE_FILE build --build-arg WAR_FILE_STAGE=external_builder --no-cache --pull artemis-app
docker compose -f $COMPOSE_FILE up --exit-code-from artemis-cypress
fi
fi

exitCode=$?
cd ..
echo "Container exit code: $exitCode"
Expand Down
14 changes: 10 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@


#### Server
- [ ] **Important**: I implemented the changes with a very good performance and prevented too many (unnecessary) database calls.
- [ ] **Important**: I implemented the changes with a [very good performance](https://docs.artemis.cit.tum.de/dev/guidelines/performance/) and prevented too many (unnecessary) and too complex database calls.
- [ ] I **strictly** followed the principle of **data economy** for all database calls.
- [ ] I **strictly** followed the [server coding and design guidelines](https://docs.artemis.cit.tum.de/dev/guidelines/server/).
- [ ] I added multiple integration tests (Spring) related to the features (with a high test coverage).
- [ ] I added pre-authorization annotations according to the [guidelines](https://docs.artemis.cit.tum.de/dev/guidelines/server/#rest-endpoint-best-practices-for-authorization) and checked the course groups for all new REST Calls (security).
- [ ] I documented the Java code using JavaDoc style.


#### Client
- [ ] **Important**: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data.
- [ ] **Important**: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data (e.g. using paging).
- [ ] I **strictly** followed the principle of **data economy** for all client-server REST calls.
- [ ] I **strictly** followed the [client coding and design guidelines](https://docs.artemis.cit.tum.de/dev/guidelines/client/).
- [ ] Following the [theming guidelines](https://docs.artemis.cit.tum.de/dev/guidelines/client-design/), I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.
- [ ] I added multiple integration tests (Jest) related to the features (with a high test coverage), while following the [test guidelines](https://docs.artemis.cit.tum.de/dev/guidelines/client-tests/).
Expand Down Expand Up @@ -92,8 +94,9 @@ Prerequisites:
<!-- All PRs that might affect the exam mode (e.g. change a client component that is also used in the exam mode) need an additional verification that the exam mode still works. -->

#### 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
<!-- See [Large Course Setup](https://github.com/ls1intum/Artemis/tree/develop/supporting_scripts/course-scripts/quick-course-setup) for the automation script that handles large course setup. -->
- [ ] 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 even for very large courses with more than 2000 students.
- [ ] I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance even for very large courses with more than 2000 students.
#### Code Review
- [ ] Code Review 1
- [ ] Code Review 2
Expand All @@ -103,6 +106,9 @@ Prerequisites:
#### Exam Mode Test
- [ ] Test 1
- [ ] Test 2
#### Performance Tests
- [ ] Test 1
- [ ] Test 2

### Test Coverage
<!-- Please add the test coverages for all changed files here. You can see this when executing the tests locally (see build.gradle and package.json) or when looking into the corresponding Bamboo build plan. -->
Expand Down
4 changes: 2 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ tests:
- changed-files:
- any-glob-to-any-file: src/test/**/*

cypress:
playwright:
- changed-files:
- any-glob-to-any-file: src/test/cypress/**/*
- any-glob-to-any-file: src/test/playwright/**/*

database:
- changed-files:
Expand Down
73 changes: 53 additions & 20 deletions .github/workflows/analysis-of-endpoint-connections.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Analysis of Endpoint Connections

on:
workflow_dispatch:
pull_request:
Expand All @@ -15,7 +17,7 @@ env:
java: 21

jobs:
analysis-of-endpoint-connections:
Parse-rest-calls-and-endpoints:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
Expand All @@ -24,39 +26,70 @@ jobs:
with:
fetch-depth: 0

- name: Get list of modified files
run: |
git diff --name-only origin/${{ github.event.pull_request.base.ref }} HEAD > modified_files.txt
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '${{ env.java }}'
distribution: 'temurin'
cache: 'gradle'

# Analyze the client sided REST-API calls
- name: Set up Node.js
- name: Set up node.js
uses: actions/setup-node@v4
with:
node-version: '${{ env.node }}'

- name: Install and compile TypeScript
- name: Parse client sided REST-API calls
run: |
cd supporting_scripts/analysis-of-endpoint-connections/src/main/typeScript/
npm install
tsc -p tsconfig.analysisOfEndpointConnections.json
- name: Run analysis-of-endpoint-connections-client
run: |
tsc -p supporting_scripts/analysis-of-endpoint-connections/src/main/typeScript/tsconfig.analysisOfEndpointConnections.json
node supporting_scripts/analysis-of-endpoint-connections/src/main/typeScript/AnalysisOfEndpointConnectionsClient.js
- name: Upload JSON file
- name: Parse server sided Endpoints
run: ./gradlew :supporting_scripts:analysis-of-endpoint-connections:runEndpointParser

- name: Upload parsing results
uses: actions/upload-artifact@v4
with:
name: rest-calls-json
path: supporting_scripts/analysis-of-endpoint-connections/restCalls.json
name: REST API Parsing Results
path: |
supporting_scripts/analysis-of-endpoint-connections/endpoints.json
supporting_scripts/analysis-of-endpoint-connections/restCalls.json
Analysis-of-endpoint-connections:
needs: Parse-rest-calls-and-endpoints
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

# Analyze the server sided endpoints
- name: Set up JDK 21
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '${{ env.java }}'
cache: 'gradle'

- name: Run analysis-of-endpoint-connections
run: |
./gradlew :supporting_scripts:analysis-of-endpoint-connections:run --args="$(cat modified_files.txt)"
- name: Download JSON files
uses: actions/download-artifact@v4
with:
name: REST API Parsing Results
path: supporting_scripts/analysis-of-endpoint-connections/

- name: Analyze endpoints
run:
./gradlew :supporting_scripts:analysis-of-endpoint-connections:runEndpointAnalysis

- name: Analyze rest calls
run:
./gradlew :supporting_scripts:analysis-of-endpoint-connections:runRestCallAnalysis

- name: Upload analysis results
uses: actions/upload-artifact@v4
with:
name: Endpoint and REST Call Analysis Results
path: |
supporting_scripts/analysis-of-endpoint-connections/endpointAnalysisResult.json
supporting_scripts/analysis-of-endpoint-connections/restCallAnalysisResult.json
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,6 @@ data-exports/
/docker/.docker-data/artemis-postgres-data/*
!/docker/.docker-data/artemis-postgres-data/.gitkeep

######################
# Cypress
######################
/src/test/cypress/screenshots/
/src/test/cypress/videos/
/src/test/cypress/build

######################
# Playwright
######################
Expand Down
Loading

0 comments on commit 035f15a

Please sign in to comment.