Page MenuHomePhabricator

D9511.id32077.diff
No OneTemporary

D9511.id32077.diff

diff --git a/services/commtest/Dockerfile b/services/commtest/Dockerfile
new file mode 100644
--- /dev/null
+++ b/services/commtest/Dockerfile
@@ -0,0 +1,32 @@
+FROM rust:1.70-bullseye
+
+RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
+ build-essential cmake git libgtest-dev libssl-dev zlib1g-dev \
+ gnupg software-properties-common
+
+# These steps are required to install terraform
+RUN wget -O- https://apt.releases.hashicorp.com/gpg | \
+ gpg --dearmor | \
+ tee /usr/share/keyrings/hashicorp-archive-keyring.gpg \
+ && echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
+ https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
+ tee /etc/apt/sources.list.d/hashicorp.list \
+ && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
+ terraform && rm -rf /var/lib/apt/lists/*
+
+WORKDIR /home/root/app/commtest
+
+# Install more recent version of protobuf, must be ran as root
+COPY scripts/install_protobuf.sh ../../scripts/install_protobuf.sh
+RUN ../../scripts/install_protobuf.sh
+
+ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
+
+# Copy actual application sources
+COPY shared ../../shared/
+COPY services/comm-services-lib ../comm-services-lib
+COPY services/terraform/dev ../terraform/dev
+COPY services/terraform/modules ../terraform/modules
+COPY services/commtest ./
+
+CMD ["bash", "./run-tests-ci.sh"]
diff --git a/services/commtest/run-tests-ci.sh b/services/commtest/run-tests-ci.sh
new file mode 100755
--- /dev/null
+++ b/services/commtest/run-tests-ci.sh
@@ -0,0 +1,32 @@
+#!/bin/env bash
+
+set -euo pipefail
+
+# Set up Localstack using Terraform
+reset_localstack() {
+ echo "Resetting Localstack..."
+ pushd ../terraform/dev >/dev/null
+ terraform init
+ terraform apply -destroy -auto-approve
+ terraform apply -auto-approve
+ popd >/dev/null
+}
+
+run_test() {
+ echo "Running test: $1"
+ RUSTFLAGS=-Awarnings cargo test --test "$1" -- --show-output
+}
+
+# Reset localstack and then run tests
+reset_localstack
+run_test "blob_*"
+run_test backup_integration_test
+run_test backup_performance_test
+# run_test grpc_client_test
+# run_test tunnelbroker_integration_tests
+# run_test tunnelbroker_persist_tests
+# run_test identity_access_tokens_tests
+# run_test identity_keyserver_tests
+# run_test identity_one_time_key_tests
+# run_test identity_prekey_tests
+# run_test identity_tunnelbroker_tests

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 26, 10:39 PM (20 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2586661
Default Alt Text
D9511.id32077.diff (2 KB)

Event Timeline