-
Notifications
You must be signed in to change notification settings - Fork 0
/
spanner-gsql.tests.cloudbuild.yaml
51 lines (46 loc) · 1.69 KB
/
spanner-gsql.tests.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
# Copyright 2024 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:
- id: Install dependencies
name: python:3.11
dir: retrieval_service
script: pip install -r requirements.txt -r requirements-test.txt --user
- id: Update config
name: python:3.11
dir: retrieval_service
script: |
#!/usr/bin/env bash
# Create config
cp example-config-spanner.yml config.yml
sed -i "s/spanner-engine/spanner-gsql/g" config.yml
sed -i "s/my-project/$PROJECT_ID/g" config.yml
sed -i "s/my-instance/${_SPANNER_INSTANCE}/g" config.yml
sed -i "s/my_database/${_DATABASE_NAME}/g" config.yml
- id: Run Spanner with gsql integration tests
name: python:3.11
dir: retrieval_service
env: # Set env var expected by tests
- "DB_PROJECT=$PROJECT_ID"
- "DB_INSTANCE=${_SPANNER_INSTANCE}"
- "DB_NAME=${_DATABASE_NAME}"
script: |
#!/usr/bin/env bash
python -m pytest datastore/providers/spanner_gsql_test.py
substitutions:
_DATABASE_NAME: test_${SHORT_SHA}
_SPANNER_INSTANCE: "my-spanner-gsql-instance"
options:
automapSubstitutions: true
substitutionOption: 'ALLOW_LOOSE'
dynamic_substitutions: true