-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
168 lines (151 loc) · 4.76 KB
/
Taskfile.yml
File metadata and controls
168 lines (151 loc) · 4.76 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
version: "3"
includes:
dashboard:
taskfile: ./packages/dashboard/Taskfile.yml
dir: ./packages/dashboard
stem:
taskfile: ./packages/stem/Taskfile.yml
dir: ./packages/stem
stem_adapter_tests:
taskfile: ./packages/stem_adapter_tests/Taskfile.yml
dir: ./packages/stem_adapter_tests
stem_builder:
taskfile: ./packages/stem_builder/Taskfile.yml
dir: ./packages/stem_builder
stem_cli:
taskfile: ./packages/stem_cli/Taskfile.yml
dir: ./packages/stem_cli
stem_memory:
taskfile: ./packages/stem_memory/Taskfile.yml
dir: ./packages/stem_memory
stem_postgres:
taskfile: ./packages/stem_postgres/Taskfile.yml
dir: ./packages/stem_postgres
stem_redis:
taskfile: ./packages/stem_redis/Taskfile.yml
dir: ./packages/stem_redis
stem_sqlite:
taskfile: ./packages/stem_sqlite/Taskfile.yml
dir: ./packages/stem_sqlite
tasks:
test:with-env:
internal: true
requires:
vars: [TASK_NAME, REQUIRED_VARS, RUN]
cmds:
- |
bash -lc '
set -euo pipefail
missing=()
for key in {{.REQUIRED_VARS}}; do
[[ -z "${!key:-}" ]] && missing+=("$key")
done
if (( ${#missing[@]} > 0 )); then
source ./packages/stem_cli/_init_test_env
missing=()
for key in {{.REQUIRED_VARS}}; do
[[ -z "${!key:-}" ]] && missing+=("$key")
done
fi
if (( ${#missing[@]} > 0 )); then
echo "DX ERROR: could not bootstrap required integration environment."
echo "Missing vars: ${missing[*]}"
echo "Run manually:"
echo " source ./packages/stem_cli/_init_test_env"
echo "Then rerun: task {{.TASK_NAME}}"
exit 1
fi
{{.RUN}}
'
test:
desc: Run all workspace package tests with integration test env bootstrapped.
cmds:
- task: test:with-env
vars:
TASK_NAME: test
REQUIRED_VARS: "STEM_TEST_REDIS_URL STEM_TEST_POSTGRES_URL"
RUN: task test:no-env
test:no-env:
desc: Run all workspace package tests without bootstrapping integration env.
cmds:
- task: dashboard:test
- task: stem:test
- task: stem_adapter_tests:test
- task: stem_builder:test
- task: stem_cli:test-multi
- task: stem_memory:test
- task: stem_postgres:test
- task: stem_redis:test
- task: stem_sqlite:test
test:contract:
desc: Run adapter contract-heavy suites with shared integration env bootstrap.
cmds:
- task: test:with-env
vars:
TASK_NAME: test:contract
REQUIRED_VARS: "STEM_TEST_REDIS_URL STEM_TEST_POSTGRES_URL"
RUN: |
task stem_adapter_tests:test
task stem_memory:test
task stem_sqlite:test
task stem_redis:test
task stem_postgres:test
test:redis:
desc: Run Redis package tests with shared integration env bootstrap.
cmds:
- task: test:with-env
vars:
TASK_NAME: test:redis
REQUIRED_VARS: STEM_TEST_REDIS_URL
RUN: task stem_redis:test
test:postgres:
desc: Run Postgres package tests with shared integration env bootstrap.
cmds:
- task: test:with-env
vars:
TASK_NAME: test:postgres
REQUIRED_VARS: STEM_TEST_POSTGRES_URL
RUN: task stem_postgres:test
coverage:
desc: Run coverage workflow with integration test env bootstrapped.
cmds:
- task: test:with-env
vars:
TASK_NAME: coverage
REQUIRED_VARS: "STEM_TEST_REDIS_URL STEM_TEST_POSTGRES_URL"
RUN: task coverage:no-env
coverage:no-env:
desc: Run coverage workflow for core packages (no env bootstrap).
cmds:
- task: stem:coverage
- task: stem_cli:coverage
- task: stem_postgres:coverage
- task: stem_redis:coverage
- task: stem_sqlite:coverage
demo:annotated:
desc: Run the annotated workflows example.
dir: ./packages/stem/example/annotated_workflows
cmds:
- dart pub get
- dart run build_runner build --delete-conflicting-outputs
- dart run bin/main.dart
demo:builder:
desc: Run the stem_builder example.
dir: ./packages/stem_builder/example
cmds:
- dart pub get
- dart run build_runner build --delete-conflicting-outputs
- dart run bin/main.dart
demo:ecommerce:test:
desc: Run the ecommerce example test suite.
dir: ./packages/stem/example/ecommerce
cmds:
- dart pub get
- dart run build_runner build --delete-conflicting-outputs
- dart test
demo:all:
desc: Run the healthy example demos from the repo root.
cmds:
- task: demo:annotated
- task: demo:builder
- task: demo:ecommerce:test