summary refs log tree commit diff
diff options
context:
space:
mode:
authorreivilibre <oliverw@matrix.org>2022-07-07 15:18:38 +0100
committerGitHub <noreply@github.com>2022-07-07 14:18:38 +0000
commit0c95313a448ab38629a13443ea9b3e0e5cc65d39 (patch)
tree02f7601b47230a235d51c2c45efaecec4f64c8eb
parentRemove obsolete RoomEventsStoreTestCase (#13200) (diff)
downloadsynapse-0c95313a448ab38629a13443ea9b3e0e5cc65d39.tar.xz
Add --build-only option to complement.sh to prevent actually running Complement. (#13158)
-rw-r--r--changelog.d/13158.misc1
-rwxr-xr-xscripts-dev/complement.sh21
2 files changed, 19 insertions, 3 deletions
diff --git a/changelog.d/13158.misc b/changelog.d/13158.misc
new file mode 100644
index 0000000000..1cb77c02d7
--- /dev/null
+++ b/changelog.d/13158.misc
@@ -0,0 +1 @@
+Add support to `complement.sh` for skipping the docker build.
diff --git a/scripts-dev/complement.sh b/scripts-dev/complement.sh
index 705243ca9b..6381f7092e 100755
--- a/scripts-dev/complement.sh
+++ b/scripts-dev/complement.sh
@@ -44,8 +44,14 @@ usage() {
 Usage: $0 [-f] <go test arguments>...
 Run the complement test suite on Synapse.
 
-  -f    Skip rebuilding the docker images, and just use the most recent
-        'complement-synapse:latest' image
+  -f, --fast
+        Skip rebuilding the docker images, and just use the most recent
+        'complement-synapse:latest' image.
+        Conflicts with --build-only.
+
+  --build-only
+        Only build the Docker images. Don't actually run Complement.
+        Conflicts with -f/--fast.
 
 For help on arguments to 'go test', run 'go help testflag'.
 EOF
@@ -53,6 +59,7 @@ EOF
 
 # parse our arguments
 skip_docker_build=""
+skip_complement_run=""
 while [ $# -ge 1 ]; do
     arg=$1
     case "$arg" in
@@ -60,9 +67,12 @@ while [ $# -ge 1 ]; do
             usage
             exit 1
             ;;
-        "-f")
+        "-f"|"--fast")
             skip_docker_build=1
             ;;
+        "--build-only")
+            skip_complement_run=1
+            ;;
         *)
             # unknown arg: presumably an argument to gotest. break the loop.
             break
@@ -106,6 +116,11 @@ if [ -z "$skip_docker_build" ]; then
     echo_if_github "::endgroup::"
 fi
 
+if [ -n "$skip_complement_run" ]; then
+    echo "Skipping Complement run as requested."
+    exit
+fi
+
 export COMPLEMENT_BASE_IMAGE=complement-synapse
 
 extra_test_args=()