ATP3 submodule for ATP3-runners that contains base bash scripts.
This directory contains modular scripts for test execution in containerized environments.
The test execution process is divided into modular components that can be easily maintained and reused across different runtime environments.
init.sh- Environment initialization and secure AWS/S3 configurationgit-clone.sh- Repository cloning and extraction (clears Git token)runtime-setup.sh- Runtime-specific environment setuptest-runner.sh- Test execution and results collection (clears sensitive vars)upload-monitor.sh- Event-based upload monitoring and finalizationnative-report.sh- Save native runner report to attachments folder
Located in runtimes/ directory for different technology stacks:
- Python:
runtimes/python-setup.sh - Playwright:
runtimes/playwright-setup.sh
The main entrypoint.sh in the root directory coordinates all modules:
#!/bin/bash
set -e
# Import modular components
source /scripts/init.sh
source /scripts/git-clone.sh
source /scripts/runtime-setup.sh
source /scripts/test-runner.sh
source /scripts/upload-results.sh
# Execute main workflow
init_environment
clone_repository
setup_runtime_environment
run_tests
upload_resultsBenefits of root-level entrypoint:
- Easy customization per image without conflicts
- Can add image-specific logic before/after main workflow
- Clear separation between image-specific and shared logic
You can create image-specific entrypoints by copying and modifying the base entrypoint:
#!/bin/bash
set -e
# Image-specific setup
echo "π Python-specific initialization..."
export PYTHONUNBUFFERED=1
# Import and execute shared modules
source /scripts/init.sh
source /scripts/git-clone.sh
source /scripts/runtime-setup.sh
source /scripts/test-runner.sh
source /scripts/upload-results.sh
# Execute main workflow
init_environment
clone_repository
setup_runtime_environment
run_tests
upload_results
# Image-specific cleanup
echo "π Python-specific cleanup completed"#!/bin/bash
set -e
# Image-specific setup
echo "π Playwright-specific initialization..."
export DISPLAY=:99
# Import and execute shared modules
source /scripts/init.sh
source /scripts/git-clone.sh
source /scripts/runtime-setup.sh
source /scripts/test-runner.sh
source /scripts/upload-results.sh
# Execute main workflow
init_environment
clone_repository
setup_runtime_environment
run_tests
upload_results
# Image-specific cleanup
echo "π Playwright-specific cleanup completed"FROM python:3.9
COPY scripts/ /scripts/
COPY runtimes/python-setup.sh /scripts/runtime-setup.sh
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]FROM mcr.microsoft.com/playwright:v1.40.0
COPY scripts/ /scripts/
COPY runtimes/playwright-setup.sh /scripts/runtime-setup.sh
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]ATP_TESTS_GIT_REPO_URL- Git repository URLATP_TESTS_GIT_REPO_BRANCH- Branch to cloneATP_TESTS_GIT_TOKEN- Git access tokenATP_STORAGE_BUCKET- S3 bucket nameATP_STORAGE_USERNAME- S3 access keyATP_STORAGE_PASSWORD- S3 secret keyENVIRONMENT_NAME- Environment nameATP_STORAGE_PROVIDER- Storage type (awsorminioors3)
CURRENT_DATE- Override current dateCURRENT_TIME- Override current timeATP_STORAGE_SERVER_URL- MinIO API hostATP_STORAGE_SERVER_UI_URL- S3 UI URLPAUSE_BEFORE_END- Pause before container exitUPLOAD_METHOD- Upload method:cp(file-based) orsync(directory-based, triggered by inotifywait)
- Modularity - Each component has a single responsibility
- Reusability - Common logic shared across different runtime images
- Maintainability - Easy to update specific functionality
- Flexibility - Easy to add new runtime support
- Testing - Individual modules can be tested separately
- Security - Sensitive credentials are cleared from environment during test execution
- Real-time upload - Results are uploaded as they are generated using inotifywait
- Flexible upload methods - Choose between file-based (cp) or directory-based (sync) upload, both triggered by inotifywait
- Create runtime-specific setup script in
runtimes/ - Create runtime-specific test runner if needed
- Update Dockerfile to copy appropriate modules
- Test with your specific runtime environment