Skip to content
Merged
Show file tree
Hide file tree
Changes from 86 commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
08890c9
Initial integration package skeleton
pcapriotti Mar 13, 2023
e053064
Initial http request machinery
pcapriotti Mar 13, 2023
0bbf30c
Add randomUser utility function
pcapriotti Mar 14, 2023
6711b4e
Show request and response on failure
pcapriotti Mar 14, 2023
8f188f4
Add user creation to test
pcapriotti Mar 14, 2023
a217b3c
Add stub for custom setup
smatting Mar 14, 2023
c1685c2
Create autogen directory in Setup.hs
pcapriotti Mar 15, 2023
810632f
Collect all tests
pcapriotti Mar 15, 2023
880c795
Parse haddock comments for tests
smatting Mar 15, 2023
99c5899
AddClient api function
pcapriotti Mar 15, 2023
5613acc
Pretty print JSON in requests and responses
pcapriotti Mar 15, 2023
f274fc0
Improve assertion failure output
pcapriotti Mar 15, 2023
13460ef
Use pattern matching instead of haskell-exts
smatting Mar 15, 2023
c190a29
Add some JSON convenience and improve response printing
smatting Mar 15, 2023
b80c11c
use tasty
smatting Mar 21, 2023
b77c623
Add missing newline in error msg
smatting Mar 22, 2023
676a0ec
nix: Add "integration" package and docker image
smatting Mar 22, 2023
2ddc84e
Fix failing test
smatting Mar 22, 2023
e66d41f
Run integration test suite on CI
smatting Mar 22, 2023
e24f579
Only run "integration" test suite on ci (undo this)
smatting Mar 22, 2023
5508331
Rename "integration" binary to "intgartion-integration"
smatting Mar 22, 2023
93bfd9c
Revert "Rename "integration" binary to "intgartion-integration""
smatting Mar 22, 2023
245549a
Add helm chart for interation test
smatting Mar 22, 2023
d17f356
Add TODO
smatting Mar 22, 2023
c43ec80
Include Host in ServiceMap
smatting Mar 22, 2023
7220acc
Make ServiceMap configureable via file
smatting Mar 22, 2023
3156e66
Add missing dependencies to nix build
smatting Mar 23, 2023
d22ef74
use integration config
smatting Mar 23, 2023
9299658
hi ci
smatting Apr 13, 2023
2332dee
Add galley secrets and configmaps to integration mounts
smatting Apr 13, 2023
aa264b0
cabal-run-integration.sh Add "integration"
smatting Apr 14, 2023
19630fd
run-service: render config files to known location
smatting Apr 14, 2023
3abd0bb
pass service configs dir to integration command
smatting Apr 14, 2023
407d5ca
withModifiedServices
smatting Apr 14, 2023
f37734b
remove arguments nonesense
smatting Apr 18, 2023
c63655d
sort tests
smatting Apr 18, 2023
58a839a
Add test testModifiedGalley
smatting Apr 18, 2023
e75438d
chart: add config and secrets from brig
smatting Apr 18, 2023
e8e9b91
Remove accedentially commited files
smatting Apr 18, 2023
9ce85ee
Move unit tests to int test section
smatting Apr 18, 2023
64196d3
fix 2 integration tests
smatting Apr 18, 2023
f0ed38a
fix bug in integration chart
smatting Apr 19, 2023
6c11f68
merge Config into App
smatting Apr 19, 2023
c519be5
Reorganize App
smatting Apr 19, 2023
02d3780
Document some functions
smatting Apr 19, 2023
b8a04e8
integration: add brig-templates to image
smatting Apr 19, 2023
c7af4fa
Don't to use AWS / internal queues in modified services
smatting Apr 19, 2023
36b49b4
add debugging break
smatting Apr 19, 2023
6b16d46
add timeout for more debugging output hopefully
smatting Apr 20, 2023
1b9c01c
regen nix
smatting Apr 20, 2023
39e1c84
Fix formatting
smatting Apr 20, 2023
0ce306d
Fix bug: serviceMap override was not using 127.0.0.1
smatting Apr 20, 2023
6cc33e8
Revert "Don't to use AWS / internal queues in modified services"
smatting Apr 20, 2023
31a8666
ingegration container: add AWS env and resources
smatting Apr 20, 2023
0ec104b
Fix another bug in chart
smatting Apr 20, 2023
41a6c5f
Revert "add timeout for more debugging output hopefully"
smatting Apr 20, 2023
96bb06b
Refctor: TestLib + TestLib.Prelude
smatting Apr 20, 2023
280b9d4
remove forever loop
smatting Apr 20, 2023
cc71382
no strings annotations
smatting Apr 20, 2023
968e518
cannon wip
smatting Apr 20, 2023
851206e
banish most operators
smatting Apr 21, 2023
31941fb
make shouldMatch be the json variant
smatting Apr 21, 2023
5248367
fix incorrect test
smatting Apr 21, 2023
6bc1ed3
cannon: fix bug
smatting Apr 21, 2023
139e873
clean up
smatting Apr 21, 2023
d553f1c
shouldMatchInt and nested lookup
smatting Apr 21, 2023
31e491d
Add addFailureContext
smatting Apr 21, 2023
097f5c7
Remove unit test
smatting Apr 21, 2023
4ce0766
clean up
smatting Apr 21, 2023
35dd7f4
Use mtl's MonadReader
smatting Apr 21, 2023
43ad8b2
more cleanup
smatting Apr 21, 2023
a9e5023
using mtl
smatting Apr 21, 2023
cb0d7a9
revert accidental changes
smatting Apr 21, 2023
b292ef4
finish a TODO
smatting Apr 21, 2023
1258ac3
Unit tests for permsToInt.
fisx Apr 26, 2023
36ab3ea
From PR #3251
fisx Apr 26, 2023
5dae97d
Add README
smatting Apr 27, 2023
19e1cf2
Add nice Makefile targets
smatting Apr 27, 2023
36fd4b9
Regen nix
smatting Apr 27, 2023
86cad7e
sanitize pr
smatting Apr 27, 2023
3c3ca13
addply linter
smatting Apr 27, 2023
022a443
hlint
fisx Apr 28, 2023
c3385a8
Make adding new team roles nicer (?)
fisx Apr 28, 2023
60451d9
Fix comment
smatting Apr 28, 2023
ddbc197
Don't deploy integration with wire-server chart
smatting Apr 28, 2023
98d2adf
Fix typos
smatting Apr 28, 2023
3b69163
Adapt test to #3252
smatting Apr 28, 2023
a45be60
Revert "Don't deploy integration with wire-server chart"
smatting Apr 28, 2023
728cbdb
Fix typos and reformulated README from code review
smatting Apr 28, 2023
41c3227
Remove unused instance
smatting Apr 28, 2023
a802ca4
Refactor shouldMatchInt and add comment
smatting Apr 28, 2023
ee1ae94
Add docs to (%.) and lookupField
smatting Apr 28, 2023
da4a4ca
Rename ProducesJSON to MakesValue
smatting Apr 28, 2023
838d2fe
remove --height - errors are all the way up there
smatting Apr 28, 2023
2acdab8
wip
smatting Apr 28, 2023
974f799
Make stacktraces nice
smatting Apr 28, 2023
ca186d0
minor thing
smatting Apr 28, 2023
7e07695
Add viewFederationDomain
smatting Apr 28, 2023
6894003
Improve Makefile targets
smatting Apr 28, 2023
fd62f54
Add -m to select tests more easily
smatting Apr 29, 2023
7040fc0
linter
smatting Apr 29, 2023
087e6bf
Make TASTY_MATCH work, and also accept comma-separated list
smatting Apr 29, 2023
7beea28
Inline context into Env
smatting Apr 29, 2023
6180de6
Update "ci" Makefile target
smatting May 2, 2023
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ target
.#*
*#*#
.*.sw[a-z]
**/__pycache__
.cabal-sandbox
ID
cabal.sandbox.config
Expand Down Expand Up @@ -113,5 +114,4 @@ result-*

services/nginz/third_party/headers-more-nginx-module
services/nginz/third_party/nginx-module-vts

**/__pycache__
services/.integration
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@ endif
ci: c db-migrate
./hack/bin/cabal-run-integration.sh $(package)


# Compile and run services
# Usage: make crun `OR` make crun package=galley
.PHONY: cr
cr: c db-migrate
./services/run-services

# Run integration from new test suite
# Usage: make devtest test=TESTNAME
.PHONY: devtest
devtest:
ghcid --height=1000 --command 'cabal repl integration' --test='Testlib.Run.runITest "$(test)"'

.PHONY: sanitize-pr
sanitize-pr:
./hack/bin/generate-local-nix-packages.sh
Expand Down
3 changes: 2 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
packages:
libs/api-bot/
integration
, libs/api-bot/
, libs/api-client/
, libs/bilge/
, libs/brig-types/
Expand Down
4 changes: 4 additions & 0 deletions charts/integration/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
description: Integration tests
name: integration
version: 0.0.42
46 changes: 46 additions & 0 deletions charts/integration/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: "integration-config"
annotations:
"helm.sh/hook": post-install
"helm.sh/hook-delete-policy": before-hook-creation
data:
integration.yaml: |
brig:
host: brig.{{ .Release.Namespace }}.svc.cluster.local
port: 8080

cannon:
host: cannon.{{ .Release.Namespace }}.svc.cluster.local
port: 8080

galley:
host: galley.{{ .Release.Namespace }}.svc.cluster.local
port: 8080

cargohold:
host: cargohold.{{ .Release.Namespace }}.svc.cluster.local
port: 8080

gundeck:
host: gundeck.{{ .Release.Namespace }}.svc.cluster.local
port: 8080

spar:
host: spar.{{ .Release.Namespace }}.svc.cluster.local
port: 8080

# not sure if this is correct
federatorInternal:
host: federator.{{ .Release.Namespace }}.svc.cluster.local
port: 8080

# not sure if this is correct
federatorExternal:
host: federator.{{ .Release.Namespace }}.svc.cluster.local
port: 8081

nginz:
host: nginz-integration-http.{{ .Release.Namespace }}.svc.cluster.local
port: 8080
72 changes: 72 additions & 0 deletions charts/integration/templates/integration-integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ .Release.Name }}-integration-integration"
annotations:
"helm.sh/hook": test
labels:
app: integration-integration
release: {{ .Release.Name }}
spec:
volumes:
- name: "integration-config"
configMap:
name: "integration-config"

- name: "galley-config"
configMap:
name: "galley"

- name: "galley-secrets"
secret:
secretName: "galley"

- name: "brig-config"
configMap:
name: "brig"

- name: "brig-secrets"
secret:
secretName: "brig"

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

restartPolicy: Never
containers:
- name: integration
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
command: [ "integration", "--config", "/etc/wire/integration/integration.yaml" ]
resources:
requests:
memory: "512Mi"
cpu: "2"
volumeMounts:

- name: "integration-config"
mountPath: "/etc/wire/integration"

- name: "galley-config"
mountPath: "/etc/wire/galley/conf"

- name: "galley-secrets"
mountPath: "/etc/wire/galley/secrets"

- name: "brig-config"
mountPath: "/etc/wire/brig/conf"

- name: "brig-secrets"
mountPath: "/etc/wire/brig/secrets"

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

env:
# these dummy values are necessary for Amazonka's "Discover"
- name: AWS_ACCESS_KEY_ID
value: "dummy"
- name: AWS_SECRET_ACCESS_KEY
value: "dummy"
- name: AWS_REGION
value: "eu-west-1"
3 changes: 3 additions & 0 deletions charts/integration/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
image:
repository: quay.io/wire/integration
tag: do-not-use
24 changes: 17 additions & 7 deletions hack/bin/cabal-run-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,27 @@ run_integration_tests() {
fi
fi

service_dir="$TOP_LEVEL/services/$package"
if [[ "$package" = "integration" ]]
then
cd "$TOP_LEVEL"
"$TOP_LEVEL/services/run-services" \
"$TOP_LEVEL/dist/integration"
"${@:2}"
else
service_dir="$TOP_LEVEL/services/$package"

cd "$service_dir"
"$TOP_LEVEL/services/run-services" \
"$TOP_LEVEL/dist/$package-integration" \
-s "$service_dir/$package.integration.yaml" \
-i "$TOP_LEVEL/services/integration.yaml" \
"${@:2}"
cd "$service_dir"
"$TOP_LEVEL/services/run-services" \
"$TOP_LEVEL/dist/$package-integration" \
-s "$service_dir/$package.integration.yaml" \
-i "$TOP_LEVEL/services/integration.yaml" \
"${@:2}"
fi
}

run_all_integration_tests() {
run_integration_tests "integration"

for d in "$TOP_LEVEL/services/"*/; do
package=$(basename "$d")
service_dir="$TOP_LEVEL/services/$package"
Expand Down
2 changes: 1 addition & 1 deletion hack/bin/integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ UPLOAD_LOGS=${UPLOAD_LOGS:-0}
echo "Running integration tests on wire-server with parallelism=${HELM_PARALLELISM} ..."

CHART=wire-server
tests=(stern galley cargohold gundeck federator spar brig)
tests=(stern galley cargohold gundeck federator spar brig integration)

cleanup() {
if (( CLEANUP_LOCAL_FILES > 0 )); then
Expand Down
2 changes: 1 addition & 1 deletion hack/bin/set-wire-server-image-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ target_version=${1?$USAGE}
TOP_LEVEL="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )"
CHARTS_DIR="$TOP_LEVEL/.local/charts"

charts=(brig cannon galley gundeck spar cargohold proxy cassandra-migrations elasticsearch-index federator backoffice)
charts=(brig cannon galley gundeck spar cargohold proxy cassandra-migrations elasticsearch-index federator backoffice integration)

for chart in "${charts[@]}"; do
sed -i "s/^ tag: .*/ tag: $target_version/g" "$CHARTS_DIR/$chart/values.yaml"
Expand Down
Loading