diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index beee1a14c..0fd228372 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,12 +23,19 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v2.4.0 hooks: + - id: check-ast + - id: check-docstring-first + - id: check-executables-have-shebangs + - id: check-merge-conflict + - id: check-symlinks + - id: debug-statements - id: trailing-whitespace - id: check-yaml - id: mixed-line-ending - id: name-tests-test args: ['--django'] - id: check-json + - id: requirements-txt-fixer - repo: https://github.com/codespell-project/codespell rev: v1.16.0 hooks: @@ -38,6 +45,10 @@ repos: rev: v0.0.3 hooks: - id: taskcluster_yml + - repo: https://github.com/asottile/yesqa + rev: v0.0.11 + hooks: + - id: yesqa - repo: meta hooks: - id: check-useless-excludes diff --git a/backend/requirements.txt b/backend/requirements.txt index becce9c79..aa15565bb 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,6 +1,7 @@ -e ../tools #egg=code-coverage-tools connexion==2.4.0 datadog==0.32.0 +fakeredis==1.1.0 Flask==1.1.1 Flask-Cors==3.0.8 flask-talisman==0.7.0 @@ -8,7 +9,6 @@ google-cloud-storage==1.23.0 gunicorn==20.0.4 python-dateutil==2.8.1 pytoml==0.1.21 -fakeredis==1.1.0 redis==3.3.11 swagger-ui-bundle==0.0.6 zstandard==0.12.0 diff --git a/bot/requirements-dev.txt b/bot/requirements-dev.txt index 4cdc62059..a88567811 100644 --- a/bot/requirements-dev.txt +++ b/bot/requirements-dev.txt @@ -1,5 +1,5 @@ -jsonschema==3.2.0 json-e==3.0.0 +jsonschema==3.2.0 pre-commit==1.20.0 pytest==5.3.1 pytest-responses==0.4.0 diff --git a/bot/tests/test_taskcluster.py b/bot/tests/test_taskcluster.py index 03794b207..5f1e062b2 100644 --- a/bot/tests/test_taskcluster.py +++ b/bot/tests/test_taskcluster.py @@ -42,7 +42,7 @@ def test_get_task( "http://taskcluster.test/api/index/v1/task/gecko.v2.mozilla-central.revision.b2a9a4bb5c94de179ae7a3f52fde58c0e2897498.firefox.linux64-ccov-opt", json=LATEST_LINUX, status=200, - ) # noqa + ) assert ( taskcluster.get_task( "mozilla-central", "b2a9a4bb5c94de179ae7a3f52fde58c0e2897498", "linux" @@ -55,7 +55,7 @@ def test_get_task( "http://taskcluster.test/api/index/v1/task/gecko.v2.mozilla-central.revision.916103b8675d9fdb28b891cac235d74f9f475942.firefox.win64-ccov-debug", json=LATEST_WIN, status=200, - ) # noqa + ) assert ( taskcluster.get_task( "mozilla-central", "916103b8675d9fdb28b891cac235d74f9f475942", "windows" @@ -70,7 +70,7 @@ def test_get_task_not_found(mock_taskcluster, TASK_NOT_FOUND): "http://taskcluster.test/api/index/v1/task/gecko.v2.mozilla-central.revision.b2a9a4bb5c94de179ae7a3f52fde58c0e2897498.firefox.linux64-ccov-opt", json=TASK_NOT_FOUND, status=404, - ) # noqa + ) assert ( taskcluster.get_task( @@ -88,7 +88,7 @@ def test_get_task_failure(mock_taskcluster, TASK_NOT_FOUND): "http://taskcluster.test/api/index/v1/task/gecko.v2.mozilla-central.revision.b2a9a4bb5c94de179ae7a3f52fde58c0e2897498.firefox.linux64-ccov-opt", json=err, status=500, - ) # noqa + ) with pytest.raises(TaskclusterRestFailure, match="Indexed task not found"): taskcluster.get_task( @@ -116,14 +116,14 @@ def test_get_tasks_in_group(mock_taskcluster, GROUP_TASKS_1, GROUP_TASKS_2): json=GROUP_TASKS_1, status=200, match_querystring=True, - ) # noqa + ) responses.add( responses.GET, "http://taskcluster.test/api/queue/v1/task-group/aPt9FbIdQwmhwDIPDYLuaw/list?continuationToken=1%2132%21YVB0OUZiSWRRd21od0RJUERZTHVhdw--~1%2132%21ZnJVcGRRT0VTalN0Nm9Ua1Ztcy04UQ--&limit=200", # noqa json=GROUP_TASKS_2, status=200, match_querystring=True, - ) # noqa + ) assert ( list(taskcluster.get_tasks_in_group("aPt9FbIdQwmhwDIPDYLuaw")) @@ -265,7 +265,7 @@ def test_get_platform(task_name, expected): def test_download_artifact_forbidden(mocked_sleep, mock_taskcluster, tmpdir): responses.add( responses.GET, - "https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/FBdocjnAQOW_GJDOfmgjxw/artifacts/public%2Ftest_info%2Fcode-coverage-grcov.zip", # noqa + "https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/FBdocjnAQOW_GJDOfmgjxw/artifacts/public%2Ftest_info%2Fcode-coverage-grcov.zip", body="xml error...", status=403, ) @@ -287,7 +287,7 @@ def test_download_artifact_forbidden(mocked_sleep, mock_taskcluster, tmpdir): def test_download_artifact_badzip(mocked_sleep, mock_taskcluster, tmpdir): responses.add( responses.GET, - "https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/FBdocjnAQOW_GJDOfmgjxw/artifacts/public%2Ftest_info%2Fcode-coverage-grcov.zip", # noqa + "https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/FBdocjnAQOW_GJDOfmgjxw/artifacts/public%2Ftest_info%2Fcode-coverage-grcov.zip", body="NOT A ZIP FILE", status=200, stream=True, diff --git a/frontend/src/base.html b/frontend/src/base.html old mode 100755 new mode 100644 diff --git a/tools/requirements.txt b/tools/requirements.txt index e29941542..233842cb0 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -1,7 +1,6 @@ +# limit async-timeout version to avoid using the alpha 4.0.0a0 +async-timeout<4.0,>=3.0 logbook +raven structlog taskcluster==24.1.0 -raven - -# limit async-timeout version to avoid using the alpha 4.0.0a0 -async-timeout<4.0,>=3.0