Skip to content

test: performance workflow improvements DHIS2-20175#22123

Merged
teleivo merged 16 commits into
masterfrom
DHIS2-20175
Oct 2, 2025
Merged

test: performance workflow improvements DHIS2-20175#22123
teleivo merged 16 commits into
masterfrom
DHIS2-20175

Conversation

@teleivo
Copy link
Copy Markdown
Contributor

@teleivo teleivo commented Oct 1, 2025

  • We used basic auth in our performance tests so far. This meant hashing showed up in our CPU profiles as we did that on every request. That is not how users should interact with our API though. Capture will login and use a cookie with the sessionid. Use the approach like in AuthenticationControllerTest and let Gatling handle the JSESSIONID cookie. Gatling detects Set-Cookie headers automatically in the response to login.
  • Allow running specific performance tests via git tag in GitHub workflow using arg perf_tests_git_ref
  • Allow profiling in GitHub workflow using arg prof_args
  • Add hard CPU limits to performance test containers so db and web containers are more isolated
  • Fix log4j2.xml configuration for performance tests as I accidentally committed it as a directory 🤦🏻
  • Use more up to date PostgreSQL version https://www.postgresql.org/support/versioning
  • Fix postgres.conf location as it was not in the default location (and not configured to look elsewhere)
  • Fix typo in dhis-2/dhis-test-performance/docker/dhis.conf
  • Simplify container startup wait logic using docker compose --wait
  • Remove Docker pull warnings by using image: localhost/... for the DB image. The DB image is purely a local image
  • Use bao image for ARM architecture support like we do in core to fix test: allow profiling performance tests DHIS2-20175 #22080 (comment)
  • Describe the purpose of Dockerfile.postgres which for now is just caching the DB dump
  • Pull mutable Docker images like dhis2/core-dev:master, dhis2/core-dev:latest, dhis2/core-pr:<pr number> so they are up to date. This is necessary as our self-hosted runner is not ephemeral so images are cached
  • Add DHIS2 Docker image labels we add to our images like DHIS2_BUILD_REVISION to the job summary. This is especially important for all the mutable images
  • Add a command to re-run the workflow with the same parameters to a job summary

Sample run

Tested these changes with

gh workflow run run-performance-tests.yml \
        --field perf_tests_git_ref="DHIS2-20175" \
        --field simulation_class="org.hisp.dhis.test.tracker.TrackerTest" \
        --field prof_args="-e cpu" \
        --field dhis2_image_baseline="dhis2/core:2.42.2" \
        --field dhis2_image_candidate="dhis2/core-dev:master" \
        --field dhis2_db_dump_url="https://databases.dhis2.org/sierra-leone/2.42.2/dhis2-db-sierra-leone.sql.gz" \
        --field dhis2_db_image_suffix="sierra-leone-2.42.2" \
        --ref DHIS2-20175

results are in https://github.com/dhis2/dhis2-core/actions/runs/18185378283

Gatling references on auth

@teleivo teleivo marked this pull request as ready for review October 2, 2025 06:48
@teleivo teleivo requested a review from a team as a code owner October 2, 2025 06:48
@teleivo teleivo requested review from ameenhere, enricocolasante, muilpp and zubaira and removed request for a team October 2, 2025 06:48
@teleivo teleivo changed the title test: performance DHIS2-20175 test: performance workflow improvements DHIS2-20175 Oct 2, 2025
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Oct 2, 2025

@teleivo teleivo enabled auto-merge (squash) October 2, 2025 13:02
@teleivo teleivo merged commit 24a5158 into master Oct 2, 2025
16 checks passed
@teleivo teleivo deleted the DHIS2-20175 branch October 2, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants