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

Tests: Remove shared subscriptions across parallel tests #669

Merged
merged 35 commits into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0d8a121
tests: refactor to remove flake in DLQ
acocuzzo Apr 22, 2022
0804b8c
refactor eod samples tests
acocuzzo Apr 22, 2022
978f5c3
remove shared subscription_admin
acocuzzo Apr 22, 2022
f357dbd
remove shared subscription_async
acocuzzo Apr 22, 2022
41f924d
remove shared subscription_sync
acocuzzo Apr 22, 2022
1c2f99a
fix merge
acocuzzo Apr 22, 2022
d0368f5
fix lint
acocuzzo Apr 22, 2022
783bf82
fix lint
acocuzzo Apr 22, 2022
d0da427
adding topic fixture
acocuzzo Apr 22, 2022
f72bc94
fix lint
acocuzzo Apr 22, 2022
4edf192
running black
acocuzzo Apr 22, 2022
be01e42
fix typos
acocuzzo Apr 22, 2022
cd51fcc
fix dlq topic
acocuzzo Apr 22, 2022
3307d62
adding topic fixture
acocuzzo Apr 22, 2022
7359447
isort
acocuzzo Apr 22, 2022
876046a
Revert "isort"
acocuzzo Apr 22, 2022
e2c00e5
topic
acocuzzo Apr 22, 2022
387106d
run lint and then black
acocuzzo Apr 22, 2022
63725ef
revert unrelated formatting changes
acocuzzo Apr 22, 2022
dc3a701
revert unrelated formatting changes
acocuzzo Apr 22, 2022
03337ac
format update to pass linter
acocuzzo Apr 22, 2022
8faa531
imports
acocuzzo Apr 22, 2022
290b225
fixing imports
acocuzzo Apr 23, 2022
24ba431
Revert "chore(python): use ubuntu 22.04 in docs image (#666)"
acocuzzo Apr 23, 2022
7f1763d
Merge branch 'main' into samples-tests-deflake
acocuzzo Apr 25, 2022
4d9bdba
Revert "Revert "chore(python): use ubuntu 22.04 in docs image (#666)""
acocuzzo Apr 23, 2022
9f8a812
Merge branch 'main' into samples-tests-deflake
parthea Apr 29, 2022
842f682
Merge branch 'main' into samples-tests-deflake
acocuzzo May 10, 2022
4ac1602
Merge branch 'main' into samples-tests-deflake
anguillanneuf May 10, 2022
0bd28b7
remove reformatting
acocuzzo May 11, 2022
dfc3f66
Merge branch 'main' into samples-tests-deflake
acocuzzo May 11, 2022
a35d6d4
add comment on parallel tests
acocuzzo May 11, 2022
f60c117
add comment on parallel tests
acocuzzo May 11, 2022
324a3f9
fix lint
acocuzzo May 12, 2022
3180b8c
Merge branch 'main' into samples-tests-deflake
acocuzzo May 12, 2022
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
5 changes: 5 additions & 0 deletions samples/snippets/publisher_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,18 @@
import publisher


# This uuid is shared across tests which run in parallel.
UUID = uuid.uuid4().hex
PROJECT_ID = os.environ["GOOGLE_CLOUD_PROJECT"]
TOPIC_ID = "publisher-test-topic-" + UUID
SUBSCRIPTION_ID = "publisher-test-subscription-" + UUID
# Allow 60s for tests to finish.
MAX_TIME = 60

# These tests run in parallel if pytest-parallel is installed.
# Avoid modifying resources that are shared across tests,
# as this results in test flake.

if typing.TYPE_CHECKING:
from unittest.mock import AsyncMock, MagicMock

Expand Down
5 changes: 5 additions & 0 deletions samples/snippets/schema_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

import schema

# This uuid is shared across tests which run in parallel.
UUID = uuid.uuid4().hex
try:
PROJECT_ID = os.environ["GOOGLE_CLOUD_PROJECT"]
Expand All @@ -45,6 +46,10 @@
AVSC_FILE = "resources/us-states.avsc"
PROTO_FILE = "resources/us-states.proto"

# These tests run in parallel if pytest-parallel is installed.
# Avoid modifying resources that are shared across tests,
# as this results in test flake.


@pytest.fixture(scope="module")
def schema_client() -> Generator[pubsub_v1.SchemaServiceClient, None, None]:
Expand Down
Loading