autotests #499

Merged
tech merged 1 commits from at-498 into main 2026-02-13 11:14:59 +00:00
16 changed files with 270 additions and 15 deletions
Showing only changes of commit 8704a968d2 - Show all commits

View File

@@ -44,6 +44,14 @@ steps:
- export PATH="$(go env GOPATH)/bin:$PATH" - export PATH="$(go env GOPATH)/bin:$PATH"
- bash ci/scripts/proto/generate.sh - bash ci/scripts/proto/generate.sh
- name: backend-tests
image: golang:alpine
depends_on: [ proto ]
commands:
- set -eu
- apk add --no-cache bash git build-base
- sh ci/scripts/common/run_backend_tests.sh bff
- name: secrets - name: secrets
image: alpine:latest image: alpine:latest
depends_on: [ version ] depends_on: [ version ]
@@ -64,7 +72,7 @@ steps:
- name: build-image - name: build-image
image: gcr.io/kaniko-project/executor:debug image: gcr.io/kaniko-project/executor:debug
depends_on: [ proto, secrets ] depends_on: [ backend-tests, secrets ]
commands: commands:
- sh ci/scripts/bff/build-image.sh - sh ci/scripts/bff/build-image.sh

View File

@@ -40,6 +40,14 @@ steps:
- export PATH="$(go env GOPATH)/bin:$PATH" - export PATH="$(go env GOPATH)/bin:$PATH"
- bash ci/scripts/proto/generate.sh - bash ci/scripts/proto/generate.sh
- name: backend-tests
image: golang:alpine
depends_on: [ proto ]
commands:
- set -eu
- apk add --no-cache bash git build-base
- sh ci/scripts/common/run_backend_tests.sh billing_documents
- name: secrets - name: secrets
image: alpine:latest image: alpine:latest
depends_on: [ version ] depends_on: [ version ]
@@ -60,7 +68,7 @@ steps:
- name: build-image - name: build-image
image: gcr.io/kaniko-project/executor:debug image: gcr.io/kaniko-project/executor:debug
depends_on: [ proto, secrets ] depends_on: [ backend-tests, secrets ]
commands: commands:
- sh ci/scripts/billing_documents/build-image.sh - sh ci/scripts/billing_documents/build-image.sh

View File

@@ -40,6 +40,14 @@ steps:
- export PATH="$(go env GOPATH)/bin:$PATH" - export PATH="$(go env GOPATH)/bin:$PATH"
- bash ci/scripts/proto/generate.sh - bash ci/scripts/proto/generate.sh
- name: backend-tests
image: golang:alpine
depends_on: [ proto ]
commands:
- set -eu
- apk add --no-cache bash git build-base
- sh ci/scripts/common/run_backend_tests.sh billing_fees
- name: secrets - name: secrets
image: alpine:latest image: alpine:latest
depends_on: [ version ] depends_on: [ version ]
@@ -60,7 +68,7 @@ steps:
- name: build-image - name: build-image
image: gcr.io/kaniko-project/executor:debug image: gcr.io/kaniko-project/executor:debug
depends_on: [ proto, secrets ] depends_on: [ backend-tests, secrets ]
commands: commands:
- sh ci/scripts/billing_fees/build-image.sh - sh ci/scripts/billing_fees/build-image.sh

View File

@@ -39,6 +39,14 @@ steps:
- export PATH="$(go env GOPATH)/bin:$PATH" - export PATH="$(go env GOPATH)/bin:$PATH"
- bash ci/scripts/proto/generate.sh - bash ci/scripts/proto/generate.sh
- name: backend-tests
image: golang:alpine
depends_on: [ proto ]
commands:
- set -eu
- apk add --no-cache bash git build-base
- sh ci/scripts/common/run_backend_tests.sh discovery
- name: secrets - name: secrets
image: alpine:latest image: alpine:latest
depends_on: [ version ] depends_on: [ version ]
@@ -59,7 +67,7 @@ steps:
- name: build-image - name: build-image
image: gcr.io/kaniko-project/executor:debug image: gcr.io/kaniko-project/executor:debug
depends_on: [ proto, secrets ] depends_on: [ backend-tests, secrets ]
commands: commands:
- sh ci/scripts/discovery/build-image.sh - sh ci/scripts/discovery/build-image.sh

View File

@@ -45,6 +45,14 @@ steps:
- export PATH="$(go env GOPATH)/bin:$PATH" - export PATH="$(go env GOPATH)/bin:$PATH"
- bash ci/scripts/proto/generate.sh - bash ci/scripts/proto/generate.sh
- name: backend-tests
image: golang:alpine
depends_on: [ proto ]
commands:
- set -eu
- apk add --no-cache bash git build-base
- sh ci/scripts/common/run_backend_tests.sh fx_ingestor
- name: secrets - name: secrets
image: alpine:latest image: alpine:latest
depends_on: [ version ] depends_on: [ version ]
@@ -65,7 +73,7 @@ steps:
- name: build-image - name: build-image
image: gcr.io/kaniko-project/executor:debug image: gcr.io/kaniko-project/executor:debug
depends_on: [ proto, secrets ] depends_on: [ backend-tests, secrets ]
commands: commands:
- sh ci/scripts/fx/build-image.sh - sh ci/scripts/fx/build-image.sh

View File

@@ -46,6 +46,14 @@ steps:
- export PATH="$(go env GOPATH)/bin:$PATH" - export PATH="$(go env GOPATH)/bin:$PATH"
- bash ci/scripts/proto/generate.sh - bash ci/scripts/proto/generate.sh
- name: backend-tests
image: golang:alpine
depends_on: [ proto ]
commands:
- set -eu
- apk add --no-cache bash git build-base
- sh ci/scripts/common/run_backend_tests.sh fx_oracle
- name: secrets - name: secrets
image: alpine:latest image: alpine:latest
depends_on: [ version ] depends_on: [ version ]
@@ -66,7 +74,7 @@ steps:
- name: build-image - name: build-image
image: gcr.io/kaniko-project/executor:debug image: gcr.io/kaniko-project/executor:debug
depends_on: [ proto, secrets ] depends_on: [ backend-tests, secrets ]
commands: commands:
- sh ci/scripts/fx/build-image.sh - sh ci/scripts/fx/build-image.sh

View File

@@ -43,6 +43,14 @@ steps:
- export PATH="$(go env GOPATH)/bin:$PATH" - export PATH="$(go env GOPATH)/bin:$PATH"
- bash ci/scripts/proto/generate.sh - bash ci/scripts/proto/generate.sh
- name: backend-tests
image: golang:alpine
depends_on: [ proto ]
commands:
- set -eu
- apk add --no-cache bash git build-base
- sh ci/scripts/common/run_backend_tests.sh gateway_chain
- name: secrets - name: secrets
image: alpine:latest image: alpine:latest
depends_on: [ version ] depends_on: [ version ]
@@ -63,7 +71,7 @@ steps:
- name: build-image - name: build-image
image: gcr.io/kaniko-project/executor:debug image: gcr.io/kaniko-project/executor:debug
depends_on: [ proto, secrets ] depends_on: [ backend-tests, secrets ]
commands: commands:
- sh ci/scripts/chain_gateway/build-image.sh - sh ci/scripts/chain_gateway/build-image.sh

View File

@@ -42,6 +42,14 @@ steps:
- export PATH="$(go env GOPATH)/bin:$PATH" - export PATH="$(go env GOPATH)/bin:$PATH"
- bash ci/scripts/proto/generate.sh - bash ci/scripts/proto/generate.sh
- name: backend-tests
image: golang:alpine
depends_on: [ proto ]
commands:
- set -eu
- apk add --no-cache bash git build-base
- sh ci/scripts/common/run_backend_tests.sh gateway_mntx
- name: secrets - name: secrets
image: alpine:latest image: alpine:latest
depends_on: [ version ] depends_on: [ version ]
@@ -62,7 +70,7 @@ steps:
- name: build-image - name: build-image
image: gcr.io/kaniko-project/executor:debug image: gcr.io/kaniko-project/executor:debug
depends_on: [ proto, secrets ] depends_on: [ backend-tests, secrets ]
commands: commands:
- sh ci/scripts/mntx/build-image.sh - sh ci/scripts/mntx/build-image.sh

View File

@@ -40,6 +40,14 @@ steps:
- export PATH="$(go env GOPATH)/bin:$PATH" - export PATH="$(go env GOPATH)/bin:$PATH"
- bash ci/scripts/proto/generate.sh - bash ci/scripts/proto/generate.sh
- name: backend-tests
image: golang:alpine
depends_on: [ proto ]
commands:
- set -eu
- apk add --no-cache bash git build-base
- sh ci/scripts/common/run_backend_tests.sh gateway_tgsettle
- name: secrets - name: secrets
image: alpine:latest image: alpine:latest
depends_on: [ version ] depends_on: [ version ]
@@ -60,7 +68,7 @@ steps:
- name: build-image - name: build-image
image: gcr.io/kaniko-project/executor:debug image: gcr.io/kaniko-project/executor:debug
depends_on: [ proto, secrets ] depends_on: [ backend-tests, secrets ]
commands: commands:
- sh ci/scripts/tgsettle/build-image.sh - sh ci/scripts/tgsettle/build-image.sh

View File

@@ -43,6 +43,14 @@ steps:
- export PATH="$(go env GOPATH)/bin:$PATH" - export PATH="$(go env GOPATH)/bin:$PATH"
- bash ci/scripts/proto/generate.sh - bash ci/scripts/proto/generate.sh
- name: backend-tests
image: golang:alpine
depends_on: [ proto ]
commands:
- set -eu
- apk add --no-cache bash git build-base
- sh ci/scripts/common/run_backend_tests.sh gateway_tron
- name: secrets - name: secrets
image: alpine:latest image: alpine:latest
depends_on: [ version ] depends_on: [ version ]
@@ -63,7 +71,7 @@ steps:
- name: build-image - name: build-image
image: gcr.io/kaniko-project/executor:debug image: gcr.io/kaniko-project/executor:debug
depends_on: [ proto, secrets ] depends_on: [ backend-tests, secrets ]
commands: commands:
- sh ci/scripts/tron_gateway/build-image.sh - sh ci/scripts/tron_gateway/build-image.sh

View File

@@ -40,6 +40,14 @@ steps:
- export PATH="$(go env GOPATH)/bin:$PATH" - export PATH="$(go env GOPATH)/bin:$PATH"
- bash ci/scripts/proto/generate.sh - bash ci/scripts/proto/generate.sh
- name: backend-tests
image: golang:alpine
depends_on: [ proto ]
commands:
- set -eu
- apk add --no-cache bash git build-base
- sh ci/scripts/common/run_backend_tests.sh ledger
- name: secrets - name: secrets
image: alpine:latest image: alpine:latest
depends_on: [ version ] depends_on: [ version ]
@@ -60,7 +68,7 @@ steps:
- name: build-image - name: build-image
image: gcr.io/kaniko-project/executor:debug image: gcr.io/kaniko-project/executor:debug
depends_on: [ proto, secrets ] depends_on: [ backend-tests, secrets ]
commands: commands:
- sh ci/scripts/ledger/build-image.sh - sh ci/scripts/ledger/build-image.sh

View File

@@ -43,6 +43,14 @@ steps:
- export PATH="$(go env GOPATH)/bin:$PATH" - export PATH="$(go env GOPATH)/bin:$PATH"
- bash ci/scripts/proto/generate.sh - bash ci/scripts/proto/generate.sh
- name: backend-tests
image: golang:alpine
depends_on: [ proto ]
commands:
- set -eu
- apk add --no-cache bash git build-base
- sh ci/scripts/common/run_backend_tests.sh notification
- name: secrets - name: secrets
image: alpine:latest image: alpine:latest
depends_on: [ version ] depends_on: [ version ]
@@ -63,7 +71,7 @@ steps:
- name: build-image - name: build-image
image: gcr.io/kaniko-project/executor:debug image: gcr.io/kaniko-project/executor:debug
depends_on: [ proto, secrets ] depends_on: [ backend-tests, secrets ]
commands: commands:
- sh ci/scripts/notification/build-image.sh - sh ci/scripts/notification/build-image.sh

View File

@@ -40,6 +40,14 @@ steps:
- export PATH="$(go env GOPATH)/bin:$PATH" - export PATH="$(go env GOPATH)/bin:$PATH"
- bash ci/scripts/proto/generate.sh - bash ci/scripts/proto/generate.sh
- name: backend-tests
image: golang:alpine
depends_on: [ proto ]
commands:
- set -eu
- apk add --no-cache bash git build-base
- sh ci/scripts/common/run_backend_tests.sh payments_methods
- name: secrets - name: secrets
image: alpine:latest image: alpine:latest
depends_on: [ version ] depends_on: [ version ]
@@ -60,7 +68,7 @@ steps:
- name: build-image - name: build-image
image: gcr.io/kaniko-project/executor:debug image: gcr.io/kaniko-project/executor:debug
depends_on: [ proto, secrets ] depends_on: [ backend-tests, secrets ]
commands: commands:
- sh ci/scripts/payments_methods/build-image.sh - sh ci/scripts/payments_methods/build-image.sh

View File

@@ -40,6 +40,14 @@ steps:
- export PATH="$(go env GOPATH)/bin:$PATH" - export PATH="$(go env GOPATH)/bin:$PATH"
- bash ci/scripts/proto/generate.sh - bash ci/scripts/proto/generate.sh
- name: backend-tests
image: golang:alpine
depends_on: [ proto ]
commands:
- set -eu
- apk add --no-cache bash git build-base
- sh ci/scripts/common/run_backend_tests.sh payments_orchestrator
- name: secrets - name: secrets
image: alpine:latest image: alpine:latest
depends_on: [ version ] depends_on: [ version ]
@@ -60,7 +68,7 @@ steps:
- name: build-image - name: build-image
image: gcr.io/kaniko-project/executor:debug image: gcr.io/kaniko-project/executor:debug
depends_on: [ proto, secrets ] depends_on: [ backend-tests, secrets ]
commands: commands:
- sh ci/scripts/payments_orchestrator/build-image.sh - sh ci/scripts/payments_orchestrator/build-image.sh

View File

@@ -42,6 +42,14 @@ steps:
- export PATH="$(go env GOPATH)/bin:$PATH" - export PATH="$(go env GOPATH)/bin:$PATH"
- bash ci/scripts/proto/generate.sh - bash ci/scripts/proto/generate.sh
- name: backend-tests
image: golang:alpine
depends_on: [ proto ]
commands:
- set -eu
- apk add --no-cache bash git build-base
- sh ci/scripts/common/run_backend_tests.sh payments_quotation
- name: secrets - name: secrets
image: alpine:latest image: alpine:latest
depends_on: [ version ] depends_on: [ version ]
@@ -62,7 +70,7 @@ steps:
- name: build-image - name: build-image
image: gcr.io/kaniko-project/executor:debug image: gcr.io/kaniko-project/executor:debug
depends_on: [ proto, secrets ] depends_on: [ backend-tests, secrets ]
commands: commands:
- sh ci/scripts/payments_quotation/build-image.sh - sh ci/scripts/payments_quotation/build-image.sh

View File

@@ -0,0 +1,135 @@
#!/usr/bin/env bash
set -eu
if ! set -o pipefail 2>/dev/null; then
:
fi
SERVICE="${1:-}"
if [ -z "${SERVICE}" ]; then
echo "usage: $0 <service-key>" >&2
exit 2
fi
REPO_ROOT="$(cd "$(dirname "$0")/../../.." && pwd)"
cd "${REPO_ROOT}"
run_go_tests() {
module="$1"
if [ ! -f "${module}/go.mod" ]; then
echo "[backend-tests] missing go.mod for module: ${module}" >&2
exit 1
fi
echo "[backend-tests] running go test ./... in ${module}"
(
cd "${module}"
go test ./...
)
}
case "${SERVICE}" in
bff)
modules="
api/pkg
api/server
"
;;
billing_documents)
modules="
api/pkg
api/billing/documents
"
;;
billing_fees)
modules="
api/pkg
api/billing/fees
"
;;
discovery)
modules="
api/pkg
api/discovery
"
;;
fx_ingestor)
modules="
api/pkg
api/fx/storage
api/fx/ingestor
"
;;
fx_oracle)
modules="
api/pkg
api/fx/storage
api/fx/oracle
"
;;
gateway_chain)
modules="
api/pkg
api/gateway/chain
"
;;
gateway_mntx)
modules="
api/pkg
api/gateway/mntx
"
;;
gateway_tgsettle)
modules="
api/pkg
api/gateway/tgsettle
"
;;
gateway_tron)
modules="
api/pkg
api/gateway/tron
"
;;
ledger)
modules="
api/pkg
api/ledger
"
;;
notification)
modules="
api/pkg
api/notification
"
;;
payments_methods)
modules="
api/pkg
api/payments/storage
api/payments/methods
"
;;
payments_orchestrator)
modules="
api/pkg
api/payments/storage
api/payments/orchestrator
"
;;
payments_quotation)
modules="
api/pkg
api/payments/storage
api/payments/quotation
"
;;
*)
echo "[backend-tests] unknown service key: ${SERVICE}" >&2
exit 2
;;
esac
for module in ${modules}; do
run_go_tests "${module}"
done