ci/matrix/README.md
This directory contains tests that verify Envoy's toolchain detection and selection behavior across different compiler configurations. These tests ensure that Bazel correctly identifies and uses the appropriate compiler toolchains (GCC vs Clang) based on various configuration methods.
NOTE: If running these tests locally, please ensure that you do not have a
user.bazelrcfile as this may interfere with the tests. The tests rely on specific default behavior that can be altered by user-specific Bazel configurations.
The test suite validates toolchain behavior in the following scenarios:
--config=clang and --config=gcc flagsCC/CXX environment variable overridesThe tests run against different Docker environments:
gcc: Only GCC availablellvm: Only LLVM/Clang availableall: Both compilers availablenone: No compilers available (tests hermetic toolchain fallback)
# ensure correct permissions
export UID
export GID
# Test only GCC configuration
docker compose -f ci/matrix/docker-compose.yml run --build gcc
# Test only LLVM configuration
docker compose -f ci/matrix/docker-compose.yml run --build llvm
# Test both compilers available
docker compose -f ci/matrix/docker-compose.yml run --build all
# Test no compilers (hermetic toolchains)
docker compose -f ci/matrix/docker-compose.yml run --build none
Successful tests will show output like:
✅ NO_ARGS passed as expected
✅ GCC passed as expected
✅ CLANG passed as expected
✅ GCC_ENV passed as expected
✅ CLANG_ENV passed as expected
All test configs passed as expected
Failed tests will show which configuration didn't match expectations:
❌ CLANG: expected=clang-libc++, got=fail
UID and GID environment variables are set correctlynone configuration is expected to fail until hermetic toolchains are fully implemented