From 05cc593da613c05bbf12ebe346b5566f315b4f6c Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Wed, 31 Jul 2019 18:11:42 -0700 Subject: [PATCH] tests: don't run video tests on ci due to rate limiting --- pywb/recorder/test/test_recorder.py | 1 + pywb/warcserver/test/test_handlers.py | 3 +++ tests/test_live_rewriter.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/pywb/recorder/test/test_recorder.py b/pywb/recorder/test/test_recorder.py index d206b3b2..70af7f2f 100644 --- a/pywb/recorder/test/test_recorder.py +++ b/pywb/recorder/test/test_recorder.py @@ -606,6 +606,7 @@ class TestRecorder(LiveServerTests, HttpBinLiveTests, FakeRedisTests, TempDirTes writer.close() assert len(writer.fh_cache) == 0 + @pytest.mark.skipif(os.environ.get('CI') is not None, reason='Skip Test on CI') def test_record_video_metadata(self): pytest.importorskip('youtube_dl') warc_path = to_path(self.root_dir + '/warcs/{user}/{coll}/') diff --git a/pywb/warcserver/test/test_handlers.py b/pywb/warcserver/test/test_handlers.py index 374b79b7..dc9ac424 100644 --- a/pywb/warcserver/test/test_handlers.py +++ b/pywb/warcserver/test/test_handlers.py @@ -11,6 +11,7 @@ from fakeredis import FakeStrictRedis from mock import patch import pytest +import os import json from warcio.recordloader import ArcWarcRecordLoader @@ -384,6 +385,7 @@ foo=bar&test=abc""" assert resp.headers['Warcserver-Source-Coll'] == 'url-agnost' assert resp.headers['Memento-Datetime'] == 'Mon, 29 Jul 2013 19:51:51 GMT' + @pytest.mark.skipif(os.environ.get('CI') is not None, reason='Skip Test on CI') def test_live_video_loader(self): pytest.importorskip('youtube_dl') params = {'url': 'http://www.youtube.com/v/BfBgWtAIbRc', @@ -402,6 +404,7 @@ foo=bar&test=abc""" assert b'WARC-Type: metadata' in resp.body assert b'Content-Type: application/vnd.youtube-dl_formats+json' in resp.body + @pytest.mark.skipif(os.environ.get('CI') is not None, reason='Skip Test on CI') def test_live_video_loader_post(self): pytest.importorskip('youtube_dl') req_data = """\ diff --git a/tests/test_live_rewriter.py b/tests/test_live_rewriter.py index 30d2cc07..7fa1a3f8 100644 --- a/tests/test_live_rewriter.py +++ b/tests/test_live_rewriter.py @@ -6,6 +6,7 @@ from pywb.warcserver.test.testutils import HttpBinLiveTests from pywb.utils.geventserver import GeventServer import pytest +import os import sys import six @@ -149,6 +150,7 @@ class TestLiveRewriter(HttpBinLiveTests, BaseConfigTest): resp = resp.follow(status=400) assert resp.status_int == 400 + @pytest.mark.skipif(os.environ.get('CI') is not None, reason='Skip Test on CI') def test_live_video_info(self): pytest.importorskip('youtube_dl') resp = self.testapp.get('/live/vi_/https://www.youtube.com/watch?v=DjFZyFWSt1M')