Skip to content

Commit 23f3417

Browse files
committed
Add test-sanitizer to docker-compose.sh and change the test behavior to run without sanitizers.
1 parent d4e3441 commit 23f3417

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

docker-compose.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,29 @@ sub_rebuild() {
7171
docker-compose -f docker-compose.yml build --force-rm --no-cache cli
7272
}
7373

74-
# Build MetaCall Docker Compose with Sanitizer for testing (link manually dockerignore files)
74+
# Build MetaCall Docker Compose for testing (link manually dockerignore files)
7575
sub_test() {
7676
# Disable BuildKit as workaround due to log limits (TODO: https://github.com/docker/buildx/issues/484)
7777
export DOCKER_BUILDKIT=0
7878

7979
ln -sf tools/deps/.dockerignore .dockerignore
8080
docker-compose -f docker-compose.yml -f docker-compose.test.yml build --force-rm deps
8181

82+
ln -sf tools/dev/.dockerignore .dockerignore
83+
docker-compose -f docker-compose.yml -f docker-compose.test.yml build --force-rm dev
84+
}
85+
86+
# Build MetaCall Docker Compose with Sanitizer for testing (link manually dockerignore files)
87+
sub_test_sanitizer() {
88+
# Disable BuildKit as workaround due to log limits (TODO: https://github.com/docker/buildx/issues/484)
89+
export DOCKER_BUILDKIT=0
90+
91+
# Enable build with sanitizer
92+
export METACALL_BUILD_SANITIZER=sanitizer
93+
94+
ln -sf tools/deps/.dockerignore .dockerignore
95+
docker-compose -f docker-compose.yml -f docker-compose.test.yml build --force-rm deps
96+
8297
ln -sf tools/dev/.dockerignore .dockerignore
8398
docker-compose -f docker-compose.yml -f docker-compose.test.yml build --force-rm dev | tee /tmp/metacall-test-output
8499

@@ -99,7 +114,7 @@ sub_test() {
99114

100115
if [ -z "${BEGIN}" ] || [ -z "${END}" ]; then
101116
echo "ERROR! CTest failed to print properly the output, run tests again:"
102-
echo " Recompiling everything: docker rmi metacall/core:dev && ./docker-compose.sh test"
117+
echo " Recompiling everything: docker rmi metacall/core:dev && ./docker-compose.sh test-sanitizer"
103118
echo " Without recompiling (needs to be built successfully previously): docker run --rm -it metacall/core:dev sh -c \"cd build && ctest -j$(getconf _NPROCESSORS_ONLN) --output-on-failure\""
104119
else
105120
BEGIN=$((BEGIN + 1))
@@ -226,6 +241,7 @@ sub_help() {
226241
echo " build"
227242
echo " rebuild"
228243
echo " test"
244+
echo " test-sanitizer"
229245
echo " cache"
230246
echo " push"
231247
echo " pack"
@@ -245,6 +261,9 @@ case "$1" in
245261
test)
246262
sub_test
247263
;;
264+
test-sanitizer)
265+
sub_test_sanitizer
266+
;;
248267
cache)
249268
sub_cache
250269
;;

docker-compose.test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ services:
3030
build:
3131
args:
3232
METACALL_BUILD_TYPE: debug
33-
METACALL_BUILD_OPTIONS: root python ruby netcore5 nodejs typescript file rpc wasm java c cobol rust examples tests scripts ports dynamic install pack sanitizer benchmarks # v8 coverage
33+
METACALL_BUILD_OPTIONS: root python ruby netcore5 nodejs typescript file rpc wasm java c cobol rust examples tests scripts ports dynamic install pack ${METACALL_BUILD_SANITIZER} benchmarks # v8 coverage

0 commit comments

Comments
 (0)