Skip to content

[video] testing: mark some tests witih flaky #3446

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

Merged
merged 2 commits into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 6 additions & 5 deletions video/cloud-client/analyze/analyze_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# limitations under the License.

import pytest
from flaky import flaky

import analyze

Expand Down Expand Up @@ -71,29 +70,31 @@ def test_speech_transcription(capsys):


# Flaky timeout
@flaky(max_runs=3, min_passes=1)
@pytest.mark.flaky(max_runs=3, min_passes=1)
def test_detect_text_gcs(capsys):
analyze.video_detect_text_gcs("gs://cloud-samples-data/video/googlework_tiny.mp4")
out, _ = capsys.readouterr()
assert 'Text' in out


# Flaky timeout
@flaky(max_runs=3, min_passes=1)
@pytest.mark.flaky(max_runs=3, min_passes=1)
def test_detect_text(capsys):
analyze.video_detect_text("resources/googlework_tiny.mp4")
out, _ = capsys.readouterr()
assert 'Text' in out


@pytest.mark.slow
# Flaky timeout
@pytest.mark.flaky(max_runs=3, min_passes=1)
def test_track_objects_gcs(capsys):
analyze.track_objects_gcs("gs://cloud-samples-data/video/cat.mp4")
out, _ = capsys.readouterr()
assert "cat" in out


@pytest.mark.slow
# Flaky timeout
@pytest.mark.flaky(max_runs=3, min_passes=1)
def test_track_objects(capsys):
in_file = "./resources/googlework_tiny.mp4"
analyze.track_objects(in_file)
Expand Down
13 changes: 6 additions & 7 deletions video/cloud-client/analyze/beta_snippets_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
import os
import uuid

import beta_snippets
from google.cloud import storage
import pytest
from flaky import flaky

import beta_snippets

POSSIBLE_TEXTS = [
"Google",
Expand Down Expand Up @@ -114,7 +113,7 @@ def test_annotation_to_storage_streaming(capsys, video_path, bucket):


# Flaky timeout
@flaky(max_runs=3, min_passes=1)
@pytest.mark.flaky(max_runs=3, min_passes=1)
def test_detect_text(capsys):
in_file = "./resources/googlework_tiny.mp4"
beta_snippets.video_detect_text(in_file)
Expand All @@ -123,15 +122,15 @@ def test_detect_text(capsys):


# Flaky timeout
@flaky(max_runs=3, min_passes=1)
@pytest.mark.flaky(max_runs=3, min_passes=1)
def test_detect_text_gcs(capsys):
in_file = "gs://python-docs-samples-tests/video/googlework_tiny.mp4"
beta_snippets.video_detect_text_gcs(in_file)
out, _ = capsys.readouterr()
assert 'Text' in out


@pytest.mark.slow
# Flaky InvalidArgument
@pytest.mark.flaky(max_runs=3, min_passes=1)
def test_track_objects(capsys):
in_file = "./resources/googlework_tiny.mp4"
beta_snippets.track_objects(in_file)
Expand All @@ -154,7 +153,7 @@ def test_track_objects_gcs():


# Flaky Gateway
@flaky(max_runs=3, min_passes=1)
@pytest.mark.flaky(max_runs=3, min_passes=1)
def test_streaming_automl_classification(capsys, video_path):
project_id = os.environ["GCLOUD_PROJECT"]
model_id = "VCN6363999689846554624"
Expand Down
3 changes: 3 additions & 0 deletions video/cloud-client/analyze/video_detect_faces_beta_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@

import os

import pytest

import video_detect_faces_beta

RESOURCES = os.path.join(os.path.dirname(__file__), "resources")


@pytest.mark.flaky(max_runs=3, min_passes=1)
def test_detect_faces(capsys):
local_file_path = os.path.join(RESOURCES, "googlework_short.mp4")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@

import os

import pytest

import video_detect_faces_gcs_beta

RESOURCES = os.path.join(os.path.dirname(__file__), "resources")


@pytest.mark.flaky(max_runs=3, min_passes=1)
def test_detect_faces(capsys):
input_uri = "gs://cloud-samples-data/video/googlework_short.mp4"

Expand Down
4 changes: 4 additions & 0 deletions video/cloud-client/analyze/video_detect_logo_gcs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@

import os

import pytest

import video_detect_logo_gcs

RESOURCES = os.path.join(os.path.dirname(__file__), "resources")


# Flaky Deadline
@pytest.mark.flaky(max_runs=3, min_passes=1)
def test_detect_logo_gcs(capsys):
input_uri = "gs://cloud-samples-data/video/googlework_tiny.mp4"

Expand Down
4 changes: 4 additions & 0 deletions video/cloud-client/analyze/video_detect_logo_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@

import os

import pytest

import video_detect_logo

RESOURCES = os.path.join(os.path.dirname(__file__), "resources")


# Flaky Bad Gateway
@pytest.mark.flaky(max_runs=3, min_passes=1)
def test_detect_logo(capsys):
local_file_path = os.path.join(RESOURCES, "googlework_tiny.mp4")

Expand Down
3 changes: 3 additions & 0 deletions video/cloud-client/analyze/video_detect_person_beta_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@

import os

import pytest

import video_detect_person_beta

RESOURCES = os.path.join(os.path.dirname(__file__), "resources")


@pytest.mark.flaky(max_runs=3, min_passes=1)
def test_detect_person(capsys):
local_file_path = os.path.join(RESOURCES, "googlework_tiny.mp4")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@

import os

import pytest

import video_detect_person_gcs_beta

RESOURCES = os.path.join(os.path.dirname(__file__), "resources")


@pytest.mark.flaky(max_runs=3, min_passes=1)
def test_detect_person(capsys):
input_uri = "gs://cloud-samples-data/video/googlework_tiny.mp4"

Expand Down