-
Notifications
You must be signed in to change notification settings - Fork 190
/
cloudbuild.yaml
100 lines (89 loc) · 3.23 KB
/
cloudbuild.yaml
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
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
steps:
# noop to pull the ci image once before the tests try to run concurrently
- name: 'gcr.io/oss-vdb/ci'
args: ['echo']
- name: 'gcr.io/cloud-builders/git'
id: 'init'
args: ['submodule', 'update', '--init']
- name: 'gcr.io/oss-vdb/ci'
id: 'lib-tests'
args: ['bash', '-ex', 'run_tests.sh']
env:
# Each concurrent test that uses the datastore emulator must have a unique port number
# lib-tests is the first test that starts the emulator. The first emulator call creates the
# test project config. Every other datastore must wait till this finishes, otherwise
# we risk multiple attempts at creating the config directory, causing failure.
- DATASTORE_EMULATOR_PORT=8002
waitFor: ['init']
# Sourcerepo-sync-tests and lib-tests use the same env so have a race condition.
- name: 'gcr.io/oss-vdb/ci'
id: 'sourcerepo-sync-tests'
dir: 'tools/sourcerepo-sync'
args: ['bash', '-ex', 'run_tests.sh']
waitFor: ['init', 'lib-tests']
- name: 'gcr.io/oss-vdb/ci'
id: 'worker-tests'
dir: gcp/workers/worker
args: ['bash', '-ex', 'run_tests.sh']
env:
# Each concurrent test that uses the datastore emulator must have a unique port number
# Wait for lib-tests to make sure the project directory is created
- DATASTORE_EMULATOR_PORT=8003
waitFor: ['init', 'lib-tests']
- name: 'gcr.io/oss-vdb/ci'
id: 'importer-tests'
dir: gcp/workers/importer
args: ['bash', '-ex', 'run_tests.sh']
env:
- CLOUD_BUILD=1
# same as worker
- DATASTORE_EMULATOR_PORT=8003
# importer uses same poetry as worker, 'poetry install' may break if run concurrently
waitFor: ['init', 'worker-tests']
- name: 'gcr.io/oss-vdb/ci'
id: 'alias-tests'
dir: gcp/workers/alias
args: ['bash', '-ex', 'run_tests.sh']
env:
# same as worker/importer
- DATASTORE_EMULATOR_PORT=8003
# alias uses same poetry as worker, 'poetry install' may break if run concurrently
waitFor: ['init', 'importer-tests']
- name: 'gcr.io/oss-vdb/ci'
id: 'website-tests'
dir: gcp/website
args: ['bash', '-ex', 'run_tests.sh']
env:
# Each concurrent test that uses the datastore emulator must have a unique port number
# Wait for lib-tests to make sure the project directory is created
- DATASTORE_EMULATOR_PORT=8004
waitFor: ['init', 'lib-tests']
- name: 'gcr.io/oss-vdb/ci'
id: 'vulnfeed-tests'
dir: vulnfeeds
args: ['bash', '-ex', 'run_tests.sh']
waitFor: ['init']
- name: 'gcr.io/oss-vdb/ci'
id: 'api-tests'
dir: gcp/api
#TODO: Update test scripts to support not supplying a credential.
args: ['bash', '-ex', 'run_tests.sh', '/workspace/dummy.json']
env:
- CLOUDBUILD=1
waitFor: ['init']
timeout: 7200s
options:
machineType: E2_HIGHCPU_8