-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdevspace.yaml
More file actions
116 lines (110 loc) · 4.4 KB
/
Copy pathdevspace.yaml
File metadata and controls
116 lines (110 loc) · 4.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
version: v2beta1
vars:
E2E_NAMESPACE:
source: env
default: agyn-platform
commands:
# Run suites against the local bundle VM (`agyn local start`) with zero
# required environment: defaults the well-known local admin token, scopes to
# the go-core suite, defaults --tag smoke, reads the ingress port from the
# agyn CLI when available, and pins the agent init images CI normally sets.
# Every default can still be overridden via the usual variables.
test-e2e-local: |-
set -euo pipefail
tags=()
while [ "$#" -gt 0 ]; do
case "$1" in
--tag) shift; tags+=("$1") ;;
--tag=*) tags+=("${1#--tag=}") ;;
*) echo "ERROR: Unknown argument: $1" >&2; exit 1 ;;
esac
shift
done
if [ "${#tags[@]}" -eq 0 ]; then
tags=(smoke)
fi
export TAGS="${tags[*]}"
# Pin to the bundle VM's context. Both this command's kubectl reads and the
# pods devspace/run-pipeline spawn follow the current context, and a running
# bootstrap k3d cluster (k3d-agyn-local) can steal it — sending the run to
# the wrong cluster. Override with AGYN_LOCAL_CONTEXT.
local_ctx="${AGYN_LOCAL_CONTEXT:-agyn-local}"
if kubectl config get-contexts -o name 2>/dev/null | grep -qx "${local_ctx}"; then
kubectl config use-context "${local_ctx}" >/dev/null
echo "e2e: using kube context ${local_ctx}"
else
echo "WARNING: kube context ${local_ctx} not found; run 'agyn local kubeconfig'" >&2
fi
# The Gateway bootstrap token is generated per install by `agyn local
# start`, so there is no longer a fixed value to fall back on. Read it from
# the credentials file the CLI wrote: `agyn profile show` deliberately
# reports only that a token is stored, never the value.
creds="${AGYN_CREDENTIALS_FILE:-${HOME}/.agyn/credentials}"
if [ -z "${AGYN_API_TOKEN:-}" ] && [ -f "${creds}" ]; then
AGYN_API_TOKEN="$(awk '
/^[^[:space:]#]/ { profile = $1; sub(":$", "", profile) }
profile == "local" && $1 == "token:" { print $2; exit }
' "${creds}")"
fi
if [ -z "${AGYN_API_TOKEN:-}" ]; then
echo "ERROR: no Gateway token; run 'agyn local credentials' or set AGYN_API_TOKEN" >&2
exit 1
fi
export AGYN_API_TOKEN
export E2E_SUITES="${E2E_SUITES:-go-core}"
# The system organization is declared by the release, and the declaration
# records the id the platform assigned on its own status.
if [ -z "${AGYN_ORGANIZATION_ID:-}" ]; then
AGYN_ORGANIZATION_ID="$(kubectl -n agyn-platform get organization.platform.agyn.io system \
-o jsonpath='{.status.organizationId}' 2>/dev/null || true)"
fi
[ -n "${AGYN_ORGANIZATION_ID:-}" ] && export AGYN_ORGANIZATION_ID
# No model id to read: a freshly installed platform has no LLM provider and
# no model. That is organization configuration rather than something a
# release ships, so the suites create their own -- see the llm fixture.
if [ -z "${E2E_INGRESS_PORT:-}" ] && command -v agyn >/dev/null 2>&1; then
E2E_INGRESS_PORT="$(agyn local config get port 2>/dev/null || true)"
fi
export E2E_INGRESS_PORT="${E2E_INGRESS_PORT:-2496}"
# No image variables. The agent runtimes are catalog records the release
# ships and the platform discovers tags for, so the suites name one and read
# the newest release from the catalog rather than being handed a reference.
export DEVSPACE_NAMESPACE="${DEVSPACE_NAMESPACE:-${E2E_NAMESPACE}}"
export E2E_NAMESPACE="${E2E_NAMESPACE}"
devspace run-pipeline test-e2e
test-e2e: |-
set -euo pipefail
tags=()
while [ "$#" -gt 0 ]; do
case "$1" in
--tag)
shift
if [ "$#" -eq 0 ]; then
echo "ERROR: --tag requires a value" >&2
exit 1
fi
tags+=("$1")
;;
--tag=*)
tags+=("${1#--tag=}")
;;
*)
echo "ERROR: Unknown argument: $1" >&2
exit 1
;;
esac
shift
done
if [ "${#tags[@]}" -gt 0 ]; then
tag_string=$(printf '%s\n' "${tags[@]}" | tr ',' '\n' | sed 's/^ *//;s/ *$//' | sed '/^$/d' | paste -sd ' ' -)
export TAGS="$tag_string"
else
export TAGS=""
fi
export DEVSPACE_NAMESPACE="${DEVSPACE_NAMESPACE:-${E2E_NAMESPACE}}"
export E2E_NAMESPACE="${E2E_NAMESPACE}"
devspace run-pipeline test-e2e
pipelines:
test-e2e:
run: |-
./scripts/run-pipeline.sh