Skip to content

Commit

Permalink
Fix urllib3 deprecation warnings, skip retry tests on OS other than L…
Browse files Browse the repository at this point in the history
…inux
  • Loading branch information
EnricoMi committed Apr 11, 2021
1 parent bce66d2 commit 5162d99
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ jobs:
publish-docker-image:
name: Publish Unit Test Results (Docker Image)
needs: test
# we run the action from this branch whenever we can (when it runs in our repo's context)
if: >
always() &&
github.event.sender.login != 'dependabot[bot]' &&
( github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository )
runs-on: ubuntu-latest

steps:
Expand Down
2 changes: 1 addition & 1 deletion publish_unit_test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get_conclusion(parsed: ParsedUnitTestResults, fail_on_failures, fail_on_erro
def get_github(token: str, url: str, retries: int, backoff_factor: float) -> github.Github:
retry = Retry(total=retries,
backoff_factor=backoff_factor,
method_whitelist=Retry.DEFAULT_METHOD_WHITELIST.union({'GET', 'POST'}),
allowed_methods=Retry.DEFAULT_ALLOWED_METHODS.union({'GET', 'POST'}),
status_forcelist=range(500, 600))
return github.Github(login_or_token=token, base_url=url, retry=retry)

Expand Down
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# dataclasses does not exist in Python3.6, needed as dependency
dataclasses
junitparser==1.6.1
PyGithub==1.54.1
dataclasses
urllib3==1.26.4
3 changes: 2 additions & 1 deletion test/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ flask
mock
pytest
pyyaml>=5.1
requests
requests
urllib3<2.0.0
2 changes: 2 additions & 0 deletions test/test_github.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import sys
import time
import unittest
from multiprocessing import Process
Expand All @@ -9,6 +10,7 @@
from publish_unit_test_results import get_github


@unittest.skipIf(sys.platform != 'linux', 'Pickling the mock REST endpoint only works Linux')
class TestGitHub(unittest.TestCase):

base_url = f'http://localhost:12380/api'
Expand Down

0 comments on commit 5162d99

Please sign in to comment.