Skip to content

Commit

Permalink
Merge pull request #15 from Informatievlaanderen/chore/refactor-tests
Browse files Browse the repository at this point in the history
Chore/refactor tests
  • Loading branch information
rorlic authored Sep 20, 2024
2 parents 859ccf6 + 4155af4 commit 9da3477
Show file tree
Hide file tree
Showing 41 changed files with 79,005 additions and 13,987 deletions.
6 changes: 6 additions & 0 deletions load-testing/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# DB credentials
POSTGRES_USER=administrator
POSTGRES_PWD=changeme
POSTGRES_DB=test
GRAFANA_USER=administrator
GRAFANA_PWD=changeme
4 changes: 2 additions & 2 deletions load-testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ for the runner:
```bash
mkdir -p ./tests
chmod o+w ./tests
mkdir -p ./logs
chmod o+w ./logs
mkdir -p ./temp
chmod o+w ./temp
```

## Start Systems
Expand Down
45 changes: 33 additions & 12 deletions load-testing/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ services:
container_name: performance_testing_grafana
image: grafana/grafana:${GRAFANA_TAG:-main}
environment:
- GF_FEATURE_TOGGLES_ENABLE=flameGraph
# - GF_FEATURE_TOGGLES_ENABLE=flameGraph
- GF_SECURITY_ADMIN_USER=${GRAFANA_USER}
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PWD}
ports:
- ${GRAFANA_PORT:-3000}:3000
networks:
Expand Down Expand Up @@ -101,11 +103,18 @@ services:
- ./workbench/config.yml:/ldio/application.yml:ro
healthcheck:
test: ["CMD", "wget", "-qO-", "http://load-testing-ldio-workbench-workbench:8080/actuator/health"]
interval: 12s
timeout: 3s
retries: 20
environment:
- SIS_DATA=/tmp
- JAVA_TOOL_OPTIONS=-XX:MaxRAMPercentage=90 -XX:MinRAMPercentage=50
- SERVER_PORT=8080
- ORCHESTRATOR_DIRECTORY=/ldio/pipelines
- SPRING_CODEC_MAXINMEMORYSIZE=10MB
- MANAGEMENT_TRACING_ENABLED=false
- MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE=health,info,prometheus
- MANAGEMENT_ENDPOINT_HEALTH_SHOWDETAILS=always
deploy:
resources:
limits:
Expand All @@ -121,11 +130,17 @@ services:
ports:
- 5432:5432
environment:
- POSTGRES_PASSWORD=admin
- POSTGRES_USER=admin
- POSTGRES_DB=test
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PWD}
networks:
- performance_testing
healthcheck:
test: pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}
interval: 10s
retries: 15
start_period: 30s
timeout: 10s
deploy:
resources:
limits:
Expand All @@ -141,7 +156,6 @@ services:
# image: ldes/ldes-server:${LDES_SERVER_TAG:-2.3.0-SNAPSHOT} # CrowdScan
# image: ldes/ldes-server:${LDES_SERVER_TAG:-2.4.1-SNAPSHOT} # Geomobility
# image: ldes/ldes-server:${LDES_SERVER_TAG:-2.10.0-SNAPSHOT} # Telraam
# image: ghcr.io/informatievlaanderen/ldes-server:20240405144556
image: ldes/ldes-server:${LDES_SERVER_TAG:-3.3.0-SNAPSHOT}
networks:
- performance_testing
Expand All @@ -151,19 +165,26 @@ services:
- ./server/tmp/epsg:/tmp/Databases:rw
- ./server/config.yml:/application.yml:ro
depends_on:
- ldes-postgres
ldes-postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-qO-", "http://ldes-server:8080/actuator/health"]
test: wget -qO- http://ldes-server:8080/actuator/health
interval: 12s
timeout: 3s
retries: 20
environment:
- SPRING_TASK_SCHEDULING_POOL_SIZE=5
- LDESSERVER_FRAGMENTATIONCRON=${LDES_SERVER_FRAGMENTATION_CRON:-*/15 * * * * *}
- SPRING_TASK_SCHEDULING_POOL_SIZE=10
- LDESSERVER_FRAGMENTATIONCRON=${LDES_SERVER_FRAGMENTATION_CRON:-*/1 * * * * *}
- SIS_DATA=/tmp
- JAVA_TOOL_OPTIONS=-XX:MaxRAMPercentage=90 -XX:MinRAMPercentage=50
- spring_Datasource_URL=jdbc:postgresql://ldes-postgres:5432/test
- SPRING_DATASOURCE_USERNAME=admin
- SPRING_DATASOURCE_PASSWORD=admin
- SPRING_DATASOURCE_URL=jdbc:postgresql://ldes-postgres:5432/${POSTGRES_DB}
- SPRING_DATASOURCE_USERNAME=${POSTGRES_USER}
- SPRING_DATASOURCE_PASSWORD=${POSTGRES_PWD}
- LDESSERVER_HOSTNAME=http://ldes-server:${LDES_SERVER_PORT:-8080}
- SERVER_PORT=8080
- LDESSERVER_RETENTIONCRON=-
- LDESSERVER_COMPACTIONCRON=-
- LDESSERVER_DELETIONCRON=-
deploy:
resources:
limits:
Expand Down
52 changes: 46 additions & 6 deletions load-testing/server/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,54 @@
# Server Tests
TODO: describe tests

### Run The Test
To run the test:
```bash
curl -X POST "http://localhost:9000/test?category=Server" -H "Content-Type: application/xml" --data-binary @./ingest.speed.08T.jmx
CATEGORY="Server%20(3.3.0)"
TEST_SERVER_BASE="http://localhost:9000"
X_API_KEY=
```

```bash
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./ingest.01T.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./ingest.02T.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./ingest.04T.jmx
```

```bash
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./fragment.01V.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./fragment.02V.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./fragment.04V.jmx
```

```bash
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./both.01T.01V.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./both.01T.02V.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./both.01T.04V.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./both.02T.01V.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./both.02T.02V.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./both.02T.04V.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./both.04T.01V.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./both.04T.02V.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./both.04T.04V.jmx
```

```bash
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./fetch.10mpp.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./fetch.100mpp.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./fetch.250mpp.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./fetch.500mpp.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./fetch.1000mpp.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./fetch.2500mpp.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./fetch.5000mpp.jmx
curl -X POST "$TEST_SERVER_BASE/test?category=$CATEGORY" -H "x-api-key: $X_API_KEY" -H "Content-Type: application/xml" --data-binary @./fetch.10000mpp.jmx
```

```bash
curl -X POST "http://localhost:9000/test?category=Server" -H "Content-Type: application/xml" --data-binary @./ingest.duration.jmx
curl -X DELETE -H "x-api-key: $X_API_KEY" "$TEST_SERVER_BASE/test/$TEST_ID"
```

```bash
curl -X POST "http://localhost:9000/test?category=Server" -H "Content-Type: application/xml" --data-binary @./fetch.250mpp.jmx
curl -X DELETE -H "x-api-key: $X_API_KEY" "$TEST_SERVER_BASE/test/$TEST_ID?confirm=true"
```

```bash
curl -X POST -H "x-api-key: $X_API_KEY" "$TEST_SERVER_BASE/status/resume"
```
Loading

0 comments on commit 9da3477

Please sign in to comment.