Skip to content

Commit cab5303

Browse files
committed
switch tests from json to yaml. fix makefile
1 parent aa07536 commit cab5303

4 files changed

Lines changed: 42 additions & 46 deletions

File tree

‎Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ endif
77
# concurrent builds on the same machine.
88
CANDIDATE_NAME ?= $(shell date +%Y-%m-%d_%H_%M)
99
IMAGE_NAME ?= google/python:$(CANDIDATE_NAME)
10+
export IMAGE_NAME
1011

1112
.PHONY: build
1213
build: build-interpreters

‎cloudbuild.yaml.in‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
steps:
2-
- name: gcr.io/cloud-builders/docker
3-
args: ['build', '--tag=interpreter', 'python-interpreter-builder']
4-
- name: interpreter
5-
args: ['cp', '/interpreters.tar.gz', '/workspace/']
6-
- name: gcr.io/cloud-builders/docker
7-
args: ['build', '--tag=${IMAGE_NAME}', '.']
8-
- name: gcr.io/gcp-runtimes/structure_test
9-
args: ['-i', 'google/python', '--config', '/workspace/tests/virtualenv/virtualenv_test.json', '-v']
2+
# - name: gcr.io/cloud-builders/docker
3+
# args: ['build', '--tag=interpreter', 'python-interpreter-builder']
4+
# - name: interpreter
5+
# args: ['cp', '/interpreters.tar.gz', '/workspace/']
6+
# - name: gcr.io/cloud-builders/docker
7+
# args: ['build', '--tag=${IMAGE_NAME}', '.']
8+
- name: gcr.io/nick-cloudbuild/structure_test:env_var
9+
args: ['-i', 'google/python', '--config', '/workspace/tests/virtualenv/virtualenv_test.yaml', '-v']
1010
images:
1111
['${IMAGE_NAME}']

‎tests/virtualenv/virtualenv_test.json‎

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
schemaVersion: "1.0.0"
2+
commandTests:
3+
- name: "env var setup"
4+
envVars: [
5+
["VIRTUAL_ENV", "/env"],
6+
["PATH", "/env/bin:$PATH"]
7+
]
8+
command: ["echo", "'setup complete'"]
9+
10+
- name: "python installation"
11+
command: ["which", "python"]
12+
expectedOutput: ["/usr/bin/python\n"]
13+
14+
- name: "virtualenv installation"
15+
setup: [["virtualenv", "/env"]]
16+
command: ["which", "python"]
17+
expectedOutput": ["/env/bin/python\n"]
18+
19+
- name: "python version"
20+
command: ["python", "--version"]
21+
expectedError: ["Python 2.7.9\n"]
22+
23+
- name: "pip installation"
24+
command: ["which", "pip"]
25+
expectedOutput: ["/env/bin/pip\n"]
26+
27+
- name: "gunicorn flask"
28+
setup: [["pip", "install", "gunicorn", "flask"]]
29+
command: ["which", "gunicorn"]
30+
expectedOutput: ["/env/bin/gunicorn"]
31+
32+
- name: "flask integration"
33+
command: ["python", "-c", "\"import sys; import flask; sys.exit(0 if flask.__file__.startswith('/env') else 1)\""]

0 commit comments

Comments
 (0)