Skip to content

Commit

Permalink
fix: mark tests with @eventually_consistent.mark
Browse files Browse the repository at this point in the history
fixes GoogleCloudPlatform#2971
fixes GoogleCloudPlatform#2972
fixes GoogleCloudPlatform#2973
fixes GoogleCloudPlatform#3085

It will likely fix those issues, not guaranteed, but it's worth a try.
  • Loading branch information
Takashi Matsuo committed Apr 6, 2020
1 parent efe5e78 commit ac2f9b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions monitoring/api/v3/alerts-client/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
pytest==5.3.2
gcp-devrel-py-tools==0.0.15
google-cloud-core
6 changes: 6 additions & 0 deletions monitoring/api/v3/alerts-client/snippets_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import random
import string

from gcp_devrel.testing import eventually_consistent
from google.cloud import monitoring_v3
import google.protobuf.json_format
import pytest
Expand Down Expand Up @@ -74,12 +75,14 @@ def pochan():
yield pochan


@eventually_consistent.mark
def test_list_alert_policies(capsys, pochan):
snippets.list_alert_policies(pochan.project_name)
out, _ = capsys.readouterr()
assert pochan.alert_policy.display_name in out


@eventually_consistent.mark
def test_enable_alert_policies(capsys, pochan):
snippets.enable_alert_policies(pochan.project_name, False)
out, _ = capsys.readouterr()
Expand All @@ -97,6 +100,7 @@ def test_enable_alert_policies(capsys, pochan):
assert "already enabled" in out


@eventually_consistent.mark
def test_replace_channels(capsys, pochan):
alert_policy_id = pochan.alert_policy.name.split('/')[-1]
notification_channel_id = pochan.notification_channel.name.split('/')[-1]
Expand All @@ -106,6 +110,7 @@ def test_replace_channels(capsys, pochan):
assert "Updated {0}".format(pochan.alert_policy.name) in out


@eventually_consistent.mark
def test_backup_and_restore(capsys, pochan):
snippets.backup(pochan.project_name, 'backup.json')
out, _ = capsys.readouterr()
Expand All @@ -117,6 +122,7 @@ def test_backup_and_restore(capsys, pochan):
pochan.notification_channel.display_name) in out


@eventually_consistent.mark
def test_delete_channels(capsys, pochan):
notification_channel_id = pochan.notification_channel.name.split('/')[-1]
snippets.delete_notification_channels(
Expand Down

0 comments on commit ac2f9b0

Please sign in to comment.