Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BQ: use random job ID for system tests. #4163

Merged
merged 1 commit into from
Oct 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions bigquery/tests/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import os
import time
import unittest
import uuid

import six

Expand Down Expand Up @@ -688,7 +689,7 @@ def test_copy_table(self):

def test_job_cancel(self):
DATASET_ID = _make_dataset_id('job_cancel')
JOB_ID = 'fetch_' + DATASET_ID
JOB_ID = 'fetch_' + DATASET_ID + str(uuid.uuid4())
TABLE_NAME = 'test_table'
QUERY = 'SELECT * FROM %s.%s' % (DATASET_ID, TABLE_NAME)

Expand Down Expand Up @@ -924,7 +925,7 @@ def test_query_w_dml(self):

query_job = Config.CLIENT.query(
query_template.format(dataset_name, table_name),
job_id='test_query_w_dml_{}'.format(unique_resource_id()))
job_id='test_query_w_dml_{}'.format(str(uuid.uuid4())))
query_job.result()

self.assertEqual(query_job.num_dml_affected_rows, 1)
Expand All @@ -940,7 +941,7 @@ def test_dbapi_w_dml(self):

Config.CURSOR.execute(
query_template.format(dataset_name, table_name),
job_id='test_dbapi_w_dml_{}'.format(unique_resource_id()))
job_id='test_dbapi_w_dml_{}'.format(str(uuid.uuid4())))
self.assertEqual(Config.CURSOR.rowcount, 1)
self.assertIsNone(Config.CURSOR.fetchone())

Expand Down Expand Up @@ -1112,7 +1113,7 @@ def test_query_w_query_params(self):
example['sql'],
job_config=jconfig,
job_id='test_query_w_query_params{}'.format(
unique_resource_id()))
str(uuid.uuid4())))
rows = list(query_job.result())
self.assertEqual(len(rows), 1)
self.assertEqual(len(rows[0]), 1)
Expand Down