Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a806f2c

Browse filesBrowse files
author
Ace Nassri
authored
Kokoro: fix + add GCF unit tests (GoogleCloudPlatform#1610)
* Fix failing/flaky tests Change-Id: Ifafc2fed676eafb86906959f4e74a94124b02460 * Add functions test Change-Id: Ifa49e29afc47d3fb070ab742ae6d70dd68a3a3c4 * Specify project ID Change-Id: If5dd88b23dba1e4b8c483fbee035b41c2dbdb72c * Add unittest back Change-Id: I84a14cde870f19a68b1022e0ef5ff1df41648d0c
1 parent 6de5e9a commit a806f2c
Copy full SHA for a806f2c

File tree

Expand file treeCollapse file tree

3 files changed

+27
-6
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+27
-6
lines changed

‎.kokoro/common.cfg

Copy file name to clipboardExpand all lines: .kokoro/common.cfg
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ env_vars: {
1212
value: "gcr.io/cloud-devrel-kokoro-resources/python"
1313
}
1414

15+
# Specify project ID
16+
env_vars: {
17+
key: "GCP_PROJECT"
18+
value: "python-docs-samples"
19+
}
20+
1521
action {
1622
define_artifacts {
1723
regex: "**/*sponge_log.xml"

‎.kokoro/presubmit_tests_functions.cfg

Copy file name to clipboard
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Download secrets from Cloud Storage.
4+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"
5+
6+
# Tell the trampoline which build file to use.
7+
env_vars: {
8+
key: "TRAMPOLINE_BUILD_FILE"
9+
value: "github/python-docs-samples/.kokoro/system_tests.sh"
10+
}
11+
12+
env_vars: {
13+
key: "NOX_SESSION"
14+
value: "functions and py27 and not venv"
15+
}

‎functions/slack/main_test.py

Copy file name to clipboardExpand all lines: functions/slack/main_test.py
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def test_verify_web_hook_valid_request(self):
5050
def test_format_slack_message(self):
5151
message = main.format_slack_message('lion', example_response)
5252

53-
assert 'lion' in message['text']
54-
assert 'lion' in message['attachments'][0]['title']
53+
assert 'lion' in message['text'].lower()
54+
assert 'lion' in message['attachments'][0]['title'].lower()
5555
assert message['attachments'][0]['color'] == '#3367d6'
5656

5757
def test_make_search_request(self):
@@ -61,8 +61,8 @@ def test_make_search_request(self):
6161
search.execute.return_value = example_response
6262
message = main.make_search_request('lion')
6363

64-
assert 'lion' in message['text']
65-
assert 'lion' in message['attachments'][0]['title']
64+
assert 'lion' in message['text'].lower()
65+
assert 'lion' in message['attachments'][0]['title'].lower()
6666
assert message['attachments'][0]['color'] == '#3367d6'
6767

6868
def test_kg_search(self):
@@ -80,5 +80,5 @@ def test_kg_search(self):
8080
with mock.patch('main.jsonify', side_effect=json.dumps):
8181
response = main.kg_search(request)
8282

83-
assert 'lion' in response
84-
assert 'color' in response
83+
assert 'lion' in response.lower()
84+
assert 'color' in response.lower()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.