-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathconfig.yml
More file actions
225 lines (221 loc) · 6.46 KB
/
config.yml
File metadata and controls
225 lines (221 loc) · 6.46 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
version: 2.1
orbs:
slack: circleci/slack@3.4.2
executors:
tap_tester:
docker:
- image: 218546966473.dkr.ecr.us-east-1.amazonaws.com/circle-ci:stitch-tap-tester
jobs:
build:
executor: tap_tester
steps:
- run: echo 'CI done'
ensure_env:
executor: tap_tester
steps:
- checkout
- run:
name: 'Setup virtual env'
command: |
python3 -mvenv /usr/local/share/virtualenvs/tap-stripe
source /usr/local/share/virtualenvs/tap-stripe/bin/activate
pip install -U pip setuptools
pip install .[test]
aws s3 cp s3://com-stitchdata-dev-deployment-assets/environments/tap-tester/tap_tester_sandbox /usr/local/share/virtualenvs/dev_env.sh
- persist_to_workspace:
root: /usr/local/share/virtualenvs/
paths:
- tap-stripe
- dev_env.sh
pylint:
executor: tap_tester
steps:
- checkout
- attach_workspace:
at: /usr/local/share/virtualenvs
- run:
name: 'pylint'
command: |
source /usr/local/share/virtualenvs/tap-stripe/bin/activate
source /usr/local/share/virtualenvs/dev_env.sh
echo "Will ignore the following errors $PYLINT_DISABLE_LIST"
pylint tap_stripe -d "$PYLINT_DISABLE_LIST"
json_validate:
executor: tap_tester
steps:
- checkout
- attach_workspace:
at: /usr/local/share/virtualenvs
- run:
name: 'JSON Validator'
command: |
source /usr/local/share/virtualenvs/tap-tester/bin/activate
stitch-validate-json tap_stripe/schemas/*.json
stitch-validate-json tap_stripe/schemas/shared/*.json
unittest:
executor: tap_tester
steps:
- checkout
- attach_workspace:
at: /usr/local/share/virtualenvs
- run:
name: 'JSON Validator'
command: |
source /usr/local/share/virtualenvs/tap-tester/bin/activate
stitch-validate-json tap_stripe/schemas/*.json
stitch-validate-json tap_stripe/schemas/shared/*.json
- run:
name: 'Unit Tests'
command: |
source /usr/local/share/virtualenvs/tap-stripe/bin/activate
nosetests tests/unittests
run_integration_test:
parameters:
file:
type: string
executor: tap_tester
steps:
- checkout
- attach_workspace:
at: /usr/local/share/virtualenvs
- run:
# TODO Instead of using always steps to make reading the output
# easier, emit an xUnit report and let Circle tell you what
# failed.
name: 'Integration Testing'
no_output_timeout: 30m
command: |
source /usr/local/share/virtualenvs/tap-stripe/bin/activate
source /usr/local/share/virtualenvs/tap-tester/bin/activate
source /usr/local/share/virtualenvs/dev_env.sh
pip install 'stripe==2.42.0'
run-test --tap=${CIRCLE_PROJECT_REPONAME} tests/test_<< parameters.file >>.py
- slack/notify-on-failure:
only_for_branches: master
workflows:
commit: &commit_jobs
jobs:
- ensure_env:
context:
- circleci-user
- tier-1-tap-user
- pylint:
context:
- circleci-user
- tier-1-tap-user
requires:
- ensure_env
- json_validate:
context:
- circleci-user
- tier-1-tap-user
requires:
- ensure_env
- unittest:
context:
- circleci-user
- tier-1-tap-user
requires:
- ensure_env
- run_integration_test:
name: 'Testing all_fields'
context:
- circleci-user
- tier-1-tap-user
file: all_fields
requires:
- unittest
- pylint
- json_validate
- run_integration_test:
name: 'Testing discovery'
context:
- circleci-user
- tier-1-tap-user
file: discovery
requires:
- 'Testing all_fields'
- run_integration_test:
name: 'Testing all_tests_run'
context:
- circleci-user
- tier-1-tap-user
file: all_tests_run
requires:
- 'Testing all_fields'
- run_integration_test:
name: 'Testing start_date'
context:
- circleci-user
- tier-1-tap-user
file: start_date
requires:
- 'Testing all_fields'
- run_integration_test:
name: 'Testing automatic_fields'
context:
- circleci-user
- tier-1-tap-user
file: automatic_fields
requires:
- 'Testing all_fields'
- run_integration_test:
name: 'Testing pagination'
context:
- circleci-user
- tier-1-tap-user
file: pagination
requires:
- 'Testing all_fields'
- run_integration_test:
name: 'Testing create_object'
context:
- circleci-user
- tier-1-tap-user
file: create_object
requires:
- 'Testing all_fields'
- run_integration_test:
name: 'Testing event_updates'
context:
- circleci-user
- tier-1-tap-user
file: event_updates
requires:
- 'Testing discovery'
- 'Testing all_tests_run'
- 'Testing start_date'
- 'Testing automatic_fields'
- 'Testing pagination'
- 'Testing create_object'
- run_integration_test:
name: 'Testing full_replication'
context:
- circleci-user
- tier-1-tap-user
file: full_replication
requires:
- 'Testing event_updates'
- run_integration_test:
name: 'Testing bookmarks'
context:
- circleci-user
- tier-1-tap-user
file: bookmarks
requires:
- 'Testing full_replication'
- build:
context:
- circleci-user
- tier-1-tap-user
requires:
- 'Testing bookmarks'
build_daily:
<<: *commit_jobs
triggers:
- schedule:
cron: "0 1 * * *"
filters:
branches:
only:
- master