Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f377d8a
fix: correct dataset name, use env var for project
leahecole Dec 16, 2019
bf3dc08
Merge branch 'master' into fix_dlp_tests
leahecole Dec 17, 2019
131dfc1
Merge branch 'master' into fix_dlp_tests
kurtisvg Dec 18, 2019
c1735af
Merge branch 'master' of github.com:GoogleCloudPlatform/python-docs-s…
leahecole Jan 2, 2020
86fb1b9
Merge branch 'master' of github.com:GoogleCloudPlatform/python-docs-s…
leahecole Jan 3, 2020
352785e
Add uuids to tests
leahecole Jan 3, 2020
503e628
add uuids and fixtures for bq
leahecole Jan 4, 2020
09465fc
Merge branch 'master' into fix_dlp_tests
leahecole Jan 4, 2020
d3a108a
Merge branch 'master' into fix_dlp_tests
leahecole Jan 6, 2020
e842941
Add logic to delete job
leahecole Jan 6, 2020
d40c636
Merge branch 'master' into fix_dlp_tests
leahecole Jan 6, 2020
e8e3019
ran black
leahecole Jan 6, 2020
b216953
Merge branch 'fix_dlp_tests' of github.com:GoogleCloudPlatform/python…
leahecole Jan 6, 2020
bc72e88
Run black with line length
leahecole Jan 6, 2020
ac8b39e
Add utf encoding for python 2 tests
leahecole Jan 7, 2020
0df064c
Merge branch 'master' into fix_dlp_tests
leahecole Jan 7, 2020
5559087
Merge branch 'master' of github.com:GoogleCloudPlatform/python-docs-s…
leahecole Jan 10, 2020
861ebc7
Merge branch 'master' into fix_dlp_tests
leahecole Jan 14, 2020
0337c44
Merge branch 'master' of github.com:GoogleCloudPlatform/python-docs-s…
leahecole Jan 16, 2020
396b534
Merge branch 'master' into fix_dlp_tests
leahecole Jan 22, 2020
c6e813e
Merge branch 'fix_dlp_tests' of github.com:GoogleCloudPlatform/python…
leahecole Feb 3, 2020
ef0a54c
Add skips for now
leahecole Feb 4, 2020
e38e348
Merge branch 'master' into fix_dlp_tests
leahecole Feb 4, 2020
cd374af
Ran black
leahecole Feb 4, 2020
61b3522
Remove skips, adjust job tests
leahecole Feb 5, 2020
93cc1a8
fix lint and skips
leahecole Feb 5, 2020
d5c26c3
Merge branch 'master' into fix_dlp_tests
leahecole Feb 5, 2020
c7db451
Merge branch 'master' into fix_dlp_tests
leahecole Feb 5, 2020
9264d58
Merge branch 'master' into fix_dlp_tests
leahecole Feb 6, 2020
7aa8607
Cleanup commented things
leahecole Feb 6, 2020
7797ce0
Merge branch 'master' into fix_dlp_tests
leahecole Feb 6, 2020
b7770ba
Merge branch 'master' into fix_dlp_tests
leahecole Feb 7, 2020
8418d57
Merge branch 'master' into fix_dlp_tests
leahecole Feb 10, 2020
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
Prev Previous commit
Next Next commit
Add uuids to tests
  • Loading branch information
leahecole committed Jan 3, 2020
commit 352785e06303e86141e7fc7a516a4060d8c0a099
15 changes: 9 additions & 6 deletions dlp/inspect_content_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import os
import uuid

from gcp_devrel.testing import eventually_consistent
from gcp_devrel.testing.flaky import flaky
Expand All @@ -26,16 +27,18 @@
import pytest
import inspect_content

UNIQUE_STRING = str(uuid.uuid4()).split("-")[0]

GCLOUD_PROJECT = os.getenv("GCLOUD_PROJECT")
TEST_BUCKET_NAME = GCLOUD_PROJECT + "-dlp-python-client-test"
TEST_BUCKET_NAME = GCLOUD_PROJECT + "-dlp-python-client-test" + UNIQUE_STRING
RESOURCE_DIRECTORY = os.path.join(os.path.dirname(__file__), "resources")
RESOURCE_FILE_NAMES = ["test.txt", "test.png", "harmless.txt", "accounts.txt"]
TOPIC_ID = "dlp-test"
SUBSCRIPTION_ID = "dlp-test-subscription"
TOPIC_ID = "dlp-test" + UNIQUE_STRING
SUBSCRIPTION_ID = "dlp-test-subscription" + UNIQUE_STRING
DATASTORE_KIND = "DLP test kind"
BIGQUERY_DATASET_ID = "dlp_test_dataset"
BIGQUERY_TABLE_ID = "dlp_test_table"
DATASTORE_NAME = "DLP test object" + UNIQUE_STRING
BIGQUERY_DATASET_ID = "dlp_test_dataset" + UNIQUE_STRING
BIGQUERY_TABLE_ID = "dlp_test_table" + UNIQUE_STRING


@pytest.fixture(scope="module")
Expand Down Expand Up @@ -108,7 +111,7 @@ def datastore_project():
datastore_client = google.cloud.datastore.Client()

kind = DATASTORE_KIND
name = "DLP test object"
name = DATASTORE_NAME
key = datastore_client.key(kind, name)
item = google.cloud.datastore.Entity(key=key)
item["payload"] = "My name is Gary Smith and my email is [email protected]"
Expand Down
9 changes: 6 additions & 3 deletions dlp/risk_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@
# limitations under the License.

from flaky import flaky
import uuid

import google.cloud.pubsub

import pytest
import os

import risk

UNIQUE_STRING = str(uuid.uuid4()).split("-")[0]
GCLOUD_PROJECT = os.environ.get('GCLOUD_PROJECT')
TABLE_PROJECT = os.environ.get('GCLOUD_PROJECT')
TOPIC_ID = "dlp-test"
SUBSCRIPTION_ID = "dlp-test-subscription"
DATASET_ID = "dlp_test_dataset"
TOPIC_ID = "dlp-test" + UNIQUE_STRING
SUBSCRIPTION_ID = "dlp-test-subscription" + UNIQUE_STRING
DATASET_ID = "integration_tests_dlp" + UNIQUE_STRING
UNIQUE_FIELD = "Name"
REPEATED_FIELD = "Mystery"
NUMERIC_FIELD = "Age"
Expand Down
5 changes: 3 additions & 2 deletions dlp/templates_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
# limitations under the License.

import os
import uuid

import google.api_core.exceptions
import google.cloud.storage

import templates


UNIQUE_STRING = str(uuid.uuid4()).split("-")[0]
GCLOUD_PROJECT = os.getenv("GCLOUD_PROJECT")
TEST_TEMPLATE_ID = "test-template"
TEST_TEMPLATE_ID = "test-template"+UNIQUE_STRING


def test_create_list_and_delete_template(capsys):
Expand Down
7 changes: 4 additions & 3 deletions dlp/triggers_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import os
import uuid

import google.api_core.exceptions
import google.cloud.storage
Expand All @@ -21,12 +22,12 @@

import triggers


UNIQUE_STRING = str(uuid.uuid4()).split("-")[0]
GCLOUD_PROJECT = os.getenv("GCLOUD_PROJECT")
TEST_BUCKET_NAME = GCLOUD_PROJECT + "-dlp-python-client-test"
TEST_BUCKET_NAME = GCLOUD_PROJECT + "-dlp-python-client-test" + UNIQUE_STRING
RESOURCE_DIRECTORY = os.path.join(os.path.dirname(__file__), "resources")
RESOURCE_FILE_NAMES = ["test.txt", "test.png", "harmless.txt", "accounts.txt"]
TEST_TRIGGER_ID = "test-trigger"
TEST_TRIGGER_ID = "test-trigger" + UNIQUE_STRING


@pytest.fixture(scope="module")
Expand Down