Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
eaf0f93
Start somewhere...
supersven Sep 23, 2025
27d49fe
Do not send events from the simulated future
supersven Sep 23, 2025
836abe8
Receive the posted events
supersven Sep 23, 2025
a4a4160
Introduce sharding
supersven Sep 24, 2025
2411e94
Use random payloads of random length
supersven Sep 24, 2025
e858c3f
Make test parameters configurable
supersven Sep 24, 2025
943daa8
Add params to Helm chart
supersven Sep 24, 2025
1ce5189
Run only testBench test in K8s
supersven Sep 24, 2025
35c69f1
Make the sharding group a cli parameter
supersven Sep 24, 2025
b7793ec
Don't setup what we don't need
supersven Sep 25, 2025
0c0c32b
Improve error message
supersven Sep 26, 2025
72c9293
Hack config for sven-test env
supersven Sep 26, 2025
c6760ae
Only use released API versions
supersven Sep 26, 2025
325bbdc
Remove log of sharding group assignment
supersven Sep 29, 2025
468c666
All users should have at least one client
supersven Sep 29, 2025
24446b6
Create fake data up to maxUserNo
supersven Sep 29, 2025
e92dc5e
Retry failed test setup functions
supersven Sep 29, 2025
0c7e08e
Print message send delay
supersven Sep 29, 2025
4148c40
Delete obsolete TODO
supersven Sep 29, 2025
256ad70
Use average payload size from prod
supersven Sep 29, 2025
59833bd
Add maxDeliveryDelay config
supersven Sep 30, 2025
12b2b16
Use released API version
supersven Sep 30, 2025
4cb2b62
Remove more unused cruft
supersven Sep 30, 2025
4301044
Start multiple instances in the integration Pod
supersven Sep 30, 2025
fdbfb1c
Configure for dev cluster
supersven Sep 30, 2025
c7790c6
serve integration chart locally
supersven Oct 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ fake-aws fake-aws-s3 fake-aws-sqs aws-ingress fluent-bit kibana backoffice \
calling-test demo-smtp elasticsearch-curator elasticsearch-external \
elasticsearch-ephemeral minio-external cassandra-external \
ingress-nginx-controller nginx-ingress-services reaper restund \
k8ssandra-test-cluster ldap-scim-bridge wire-server-enterprise
k8ssandra-test-cluster ldap-scim-bridge wire-server-enterprise \
integration
KIND_CLUSTER_NAME := wire-server
HELM_PARALLELISM ?= 1 # 1 for sequential tests; 6 for all-parallel tests
# (run `psql -h localhost -p 5432 -d backendA -U wire-server -w` for the list of options for PSQL_DB)
Expand Down
11 changes: 8 additions & 3 deletions charts/integration/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,16 @@ data:
apiPort: 5380
dohPort: 5381

originDomain: federation-test-helper.{{ .Release.Namespace }}.svc.cluster.local
# originDomain: federation-test-helper.{{ .Release.Namespace }}.svc.cluster.local
# sven-test.wire.link
originDomain: dev.zinfra.io

rabbitmq:
host: rabbitmq
port: 5671
adminHost: rabbitmq
adminPort: 15671
enableTls: true
adminPort: 15672
enableTls: false
insecureSkipVerifyTls: true
vHost: /

Expand Down Expand Up @@ -305,3 +307,6 @@ data:

integrationTestHostName: integration-headless.{{ .Release.Namespace }}.svc.cluster.local
cellsEventQueue: cells_events
shardingGroupCount: {{ .Values.config.shardingGroupCount }}
maxUserNo: {{ .Values.config.maxUserNo }}
maxDeliveryDelay: {{ .Values.config.maxDeliveryDelay }}
170 changes: 23 additions & 147 deletions charts/integration/templates/integration-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ spec:
secret:
secretName: "brig"

- name: "turn-servers"
configMap:
name: "turn"

- name: "cannon-config"
configMap:
name: "cannon"
Expand All @@ -49,33 +45,6 @@ spec:
configMap:
name: "spar"

- name: "federator-config"
configMap:
name: "federator"

- name: "federator-secrets"
secret:
secretName: "federator-certificate-secret"

- name: "federator-ca"
configMap:
name: "federator-ca"
- name: "background-worker-config"
configMap:
name: "background-worker"

- name: "stern-config"
configMap:
name: "backoffice"

- name: "proxy-config"
configMap:
name: "proxy"

- name: "proxy-secrets"
secret:
secretName: "proxy"

- name: "nginz-config"
configMap:
name: "nginz"
Expand All @@ -84,28 +53,12 @@ spec:
secret:
secretName: "nginz"

- name: elasticsearch-ca
secret:
secretName: {{ .Values.config.elasticsearch.tlsCaSecretRef.name }}

- name: redis-ca
secret:
secretName: {{ .Values.config.redis.tlsCaSecretRef.name }}

- name: rabbitmq-ca
secret:
secretName: {{ .Values.config.rabbitmq.tlsCaSecretRef.name }}

{{- if eq (include "useCassandraTLS" .Values.config) "true" }}
- name: integration-cassandra
secret:
secretName: {{ include "cassandraTlsSecretName" .Values.config }}
{{- end }}

- name: wire-server-enterprise-config
configMap:
name: wire-server-enterprise

restartPolicy: Never

initContainers:
Expand All @@ -116,14 +69,10 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 6 }}
{{- end }}
volumeMounts:
- name: elasticsearch-ca
mountPath: "/certs/elasticsearch"
{{- if eq (include "useCassandraTLS" .Values.config) "true" }}
- name: "integration-cassandra"
mountPath: "/certs/cassandra"
{{- end }}
- name: rabbitmq-ca
mountPath: /certs/rabbitmq-ca
env:
- name: INTEGRATION_DYNAMIC_BACKENDS_POOLSIZE
value: "{{ .Values.config.dynamicBackendsPoolsize }}"
Expand All @@ -136,32 +85,19 @@ spec:
- name: RABBITMQ_USERNAME
valueFrom:
secretKeyRef:
name: brig
name: gundeck
key: rabbitmqUsername
- name: RABBITMQ_PASSWORD
valueFrom:
secretKeyRef:
name: brig
name: gundeck
key: rabbitmqPassword
command:
- /bin/sh
- -c
- |
set -euo pipefail
# FUTUREWORK: Do all of this in the integration test binary
integration-dynamic-backends-db-schemas.sh \
--host {{ .Values.config.cassandra.host }} \
--port {{ .Values.config.cassandra.port }} \
--replication-factor {{ .Values.config.cassandra.replicationFactor }} \
{{- if eq (include "useCassandraTLS" .Values.config) "true" }}
--tls-ca-certificate-file /certs/cassandra/{{- include "cassandraTlsSecretKey" .Values.config }}
{{ end }}

integration-dynamic-backends-brig-index.sh \
--elasticsearch-server https://elastic:changeme@{{ .Values.config.elasticsearch.host }}:9200 \
--elasticsearch-ca-cert /certs/elasticsearch/{{ .Values.config.elasticsearch.tlsCaSecretRef.key }}
integration-dynamic-backends-ses.sh {{ .Values.config.sesEndpointUrl }}
integration-dynamic-backends-s3.sh {{ .Values.config.s3EndpointUrl }}

{{- range $name, $dynamicBackend := .Values.config.dynamicBackends }}
integration-dynamic-backends-vhosts.sh {{ $.Values.config.rabbitmqPutVHostUrl }} {{ $dynamicBackend.federatorExternalHostPrefix}}.{{ $.Release.Namespace }}.svc.cluster.local
{{- end }}
Expand All @@ -171,25 +107,26 @@ spec:
cpu: "2"

containers:
- name: integration
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
{{- if eq (include "includeSecurityContext" .) "true" }}
{{- range $i := until (int .Values.config.shardingGroupCount) }}
- name: "integration-{{ int $i}}"
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}"
{{- if eq (include "includeSecurityContext" $) "true" }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 6 }}
{{- toYaml $.Values.podSecurityContext | nindent 6 }}
{{- end }}
command:
- /bin/bash
- -c
- |
set -euo pipefail

if integration --config /etc/wire/integration/integration.yaml; then
if TEST_INCLUDE=testBench integration --config /etc/wire/integration/integration.yaml --sharding-group {{ $i }}; then
exit_code=$?
else
exit_code=$?
fi

{{- if .Values.config.uploadXml }}
{{- if $.Values.config.uploadXml }}
# In case a different S3 compliant storage is used to upload test result.
if ! [[ -z "${UPLOAD_XML_AWS_ACCESS_KEY_ID+x}" ]]; then
export AWS_ACCESS_KEY_ID="$UPLOAD_XML_AWS_ACCESS_KEY_ID"
Expand All @@ -205,7 +142,7 @@ spec:
resources:
requests:
memory: "512Mi"
cpu: "2"
cpu: "0.5"
volumeMounts:

- name: integration-config
Expand All @@ -223,9 +160,6 @@ spec:
- name: brig-secrets
mountPath: /etc/wire/brig/secrets

- name: turn-servers
mountPath: /etc/wire/brig/turn

- name: cannon-config
mountPath: /etc/wire/cannon/conf

Expand All @@ -238,55 +172,13 @@ spec:
- name: spar-config
mountPath: /etc/wire/spar/conf

- name: federator-config
mountPath: /etc/wire/federator/conf

- name: federator-secrets
mountPath: /etc/wire/federator/secrets

- name: federator-ca
mountPath: /etc/wire/federator/ca

- name: background-worker-config
mountPath: /etc/wire/background-worker/conf

- name: stern-config
mountPath: /etc/wire/stern/conf

- name: proxy-config
mountPath: /etc/wire/proxy/conf

- name: proxy-secrets
mountPath: /etc/wire/proxy/secrets

- name: nginz-config
mountPath: /etc/wire/nginz/conf

- name: nginz-secrets
mountPath: /etc/wire/nginz/secrets

- name: elasticsearch-ca
mountPath: /etc/wire/brig/elasticsearch-ca

- name: redis-ca
mountPath: /etc/wire/gundeck/redis-ca

- name: rabbitmq-ca
mountPath: /etc/wire/brig/rabbitmq-ca

- name: rabbitmq-ca
mountPath: /etc/wire/galley/rabbitmq-ca

- name: rabbitmq-ca
mountPath: /etc/wire/background-worker/rabbitmq-ca

- name: rabbitmq-ca
mountPath: /etc/wire/gundeck/rabbitmq-ca

- name: rabbitmq-ca
mountPath: /etc/wire/cannon/rabbitmq-ca

{{- if eq (include "useCassandraTLS" .Values.config) "true" }}
{{- if eq (include "useCassandraTLS" $.Values.config) "true" }}
- name: "integration-cassandra"
mountPath: "/certs"

Expand All @@ -303,9 +195,6 @@ spec:
mountPath: "/etc/wire/spar/cassandra"
{{- end }}

- name: wire-server-enterprise-config
mountPath: /etc/wire/wire-server-enterprise/conf

env:
# these dummy values are necessary for Amazonka's "Discover"
- name: AWS_ACCESS_KEY_ID
Expand All @@ -317,35 +206,21 @@ spec:
- name: RABBITMQ_USERNAME
valueFrom:
secretKeyRef:
name: brig
name: gundeck
key: rabbitmqUsername
- name: RABBITMQ_PASSWORD
valueFrom:
secretKeyRef:
name: brig
name: gundeck
key: rabbitmqPassword
- name: RABBITMQ_USERNAME_V0
value: "wire-server"
- name: RABBITMQ_PASSWORD_V0
valueFrom:
secretKeyRef:
name: rabbitmq-v0
key: rabbitmq-password
- name: RABBITMQ_USERNAME_V1
value: "wire-server"
- name: RABBITMQ_PASSWORD_V1
valueFrom:
secretKeyRef:
name: rabbitmq-v1
key: rabbitmq-password
{{- if hasKey .Values.secrets "redisUsername" }}
{{- if hasKey $.Values.secrets "redisUsername" }}
- name: REDIS_USERNAME
valueFrom:
secretKeyRef:
name: integration
key: redisUsername
{{- end }}
{{- if hasKey .Values.secrets "redisPassword" }}
{{- if hasKey $.Values.secrets "redisPassword" }}
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
Expand All @@ -354,10 +229,10 @@ spec:
{{- end }}
- name: TEST_XML
value: /tmp/result.xml
{{- if .Values.config.uploadXml }}
{{- if $.Values.config.uploadXml }}
- name: UPLOAD_XML_S3_BASE_URL
value: {{ .Values.config.uploadXml.baseUrl }}
{{- if .Values.secrets.uploadXmlAwsAccessKeyId }}
value: {{ $.Values.config.uploadXml.baseUrl }}
{{- if $.Values.secrets.uploadXmlAwsAccessKeyId }}
- name: UPLOAD_XML_AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
Expand All @@ -371,8 +246,9 @@ spec:
{{- end }}
{{- end }}
- name: ENABLE_FEDERATION_V0
value: "1"
value: "0"
- name: ENABLE_FEDERATION_V1
value: "1"
value: "0"
- name: ENABLE_FEDERATION_V2
value: "1"
value: "0"
{{- end }}
9 changes: 6 additions & 3 deletions charts/integration/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ podSecurityContext:
type: RuntimeDefault

config:
dynamicBackendsPoolsize: 3
dynamicBackendsPoolsize: 0
dynamicBackends:
dynamic-backend-1:
federatorExternalHostPrefix: dynamic-backend-1
Expand Down Expand Up @@ -118,8 +118,11 @@ config:
sqsEndpointUrl: http://fake-aws-sqs:4568
sesEndpointUrl: http://fake-aws-ses:4569
s3EndpointUrl: http://fake-aws-s3:9000
rabbitmqPutVHostUrl: http://rabbitmq:15672/api/vhosts

rabbitmqPutVHostUrl: http://rabbitmq-b.databases.svc.cluster.local:15672/api/vhosts
shardingGroupCount: 3
# shardingGroup: 0
maxUserNo: 1000
maxDeliveryDelay: 120
tls:
verify_depth: 1
# Namespace from which to obtain the secret containing the CA trusted by
Expand Down
2 changes: 2 additions & 0 deletions integration/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
, split
, stm
, streaming-commons
, streamly
, string-conversions
, system-linux-proc
, tagged
Expand Down Expand Up @@ -179,6 +180,7 @@ mkDerivation {
split
stm
streaming-commons
streamly
string-conversions
system-linux-proc
tagged
Expand Down
Loading