-
Notifications
You must be signed in to change notification settings - Fork 841
Add env vars for Gradle commands in test scripts #3649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The following env vars can be set to control which tests are run UAA_GRADLE_INT_TEST_COMMAND UAA_GRADLE_UNIT_TEST_COMMAND the UAA_DOCKER_ARGS env var can be set to pass additional settings to the docker container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds environment variable support to control Gradle test commands and Docker container arguments in the UAA test scripts, enabling developers to run specific tests or configure container settings without modifying the scripts themselves.
- Introduces
UAA_GRADLE_UNIT_TEST_COMMANDandUAA_GRADLE_INT_TEST_COMMANDenvironment variables to customize which tests are executed - Adds
UAA_DOCKER_ARGSenvironment variable to pass additional configuration to Docker containers - Updates documentation in all affected scripts to describe the new environment variables
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/unit_tests.sh | Replaces hardcoded test command with configurable UAA_GRADLE_UNIT_TEST_COMMAND variable |
| scripts/integration_tests.sh | Replaces hardcoded integrationTest command with configurable UAA_GRADLE_INT_TEST_COMMAND variable |
| scripts/start_docker_database.sh | Adds support for UAA_DOCKER_ARGS to pass additional Docker arguments |
| run-unit-tests.sh | Documents and passes through UAA_DOCKER_ARGS and UAA_GRADLE_UNIT_TEST_COMMAND to container |
| run-integration-tests.sh | Documents and passes through UAA_DOCKER_ARGS and UAA_GRADLE_INT_TEST_COMMAND to container |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| --volume "${script_dir}":"${container_script_dir}" \ | ||
| --volume "${gradle_lock_dir}" \ | ||
| --env DB="${DB}" \ | ||
| ${UAA_DOCKER_ARGS:-} \ |
Copilot
AI
Oct 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UAA_DOCKER_ARGS variable is expanded without quotes, which could allow command injection if it contains malicious input. Consider validating or sanitizing this variable, or ensure it's only used in trusted environments.
| ${UAA_DOCKER_ARGS:-} \ | |
| "${UAA_DOCKER_ARGS:-}" \ |
| ${UAA_DOCKER_ARGS:-} \ | ||
| --env UAA_GRADLE_INT_TEST_COMMAND="${UAA_GRADLE_INT_TEST_COMMAND:-integrationTest}" \ |
Copilot
AI
Oct 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UAA_DOCKER_ARGS variable is expanded without quotes, which could allow command injection if it contains malicious input. Consider validating or sanitizing this variable, or ensure it's only used in trusted environments.
| --publish "${db_port}:${db_port}" \ | ||
| ${DEBUG_MODE:+--publish "5005:5005"} \ | ||
| ${WEB_MODE:+--publish "8080:8080"} \ | ||
| ${UAA_DOCKER_ARGS:-} \ |
Copilot
AI
Oct 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UAA_DOCKER_ARGS variable is expanded without quotes, which could allow command injection if it contains malicious input. Consider validating or sanitizing this variable, or ensure it's only used in trusted environments.
The following env vars can be set to control which tests are run
UAA_GRADLE_INT_TEST_COMMAND
UAA_GRADLE_UNIT_TEST_COMMAND
the UAA_DOCKER_ARGS env var can be set to pass additional settings to the docker container