From 2f820a85f24bd1d3310d583f1318a8543effcc3e Mon Sep 17 00:00:00 2001 From: Enrico Minack Date: Wed, 27 Jul 2022 22:24:40 +0200 Subject: [PATCH] Remove remaining unit terms except for repository name (#336) --- Dockerfile | 8 ++++---- action.yml | 2 +- composite/action.yml | 4 ++-- ...nit_test_results.py => publish_test_results.py} | 0 python/test/test_action_script.py | 14 +++++++------- python/test/test_github.py | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) rename python/{publish_unit_test_results.py => publish_test_results.py} (100%) diff --git a/Dockerfile b/Dockerfile index 79e80488..455b6ede 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,8 @@ LABEL repository="https://github.com/EnricoMi/publish-unit-test-result-action" LABEL homepage="https://github.com/EnricoMi/publish-unit-test-result-action" LABEL maintainer="Enrico Minack " -LABEL com.github.actions.name="Publish Unit Test Results" -LABEL com.github.actions.description="A GitHub Action to publish unit test results." +LABEL com.github.actions.name="Publish Test Results" +LABEL com.github.actions.description="A GitHub Action to publish test results." LABEL com.github.actions.icon="check-circle" LABEL com.github.actions.color="green" @@ -18,6 +18,6 @@ RUN apk add --no-cache build-base libffi-dev; \ apk del build-base libffi-dev COPY python/publish /action/publish -COPY python/publish_unit_test_results.py /action/ +COPY python/publish_test_results.py /action/ -ENTRYPOINT ["python", "/action/publish_unit_test_results.py"] +ENTRYPOINT ["python", "/action/publish_test_results.py"] diff --git a/action.yml b/action.yml index 1322d73f..66909b40 100644 --- a/action.yml +++ b/action.yml @@ -1,4 +1,4 @@ -name: 'Publish Unit Test Results' +name: 'Publish Test Results' author: 'EnricoMi' description: 'A GitHub Action that publishes test results on GitHub' diff --git a/composite/action.yml b/composite/action.yml index 6f5ff243..244163cf 100644 --- a/composite/action.yml +++ b/composite/action.yml @@ -1,4 +1,4 @@ -name: 'Publish Unit Test Results' +name: 'Publish Test Results' author: 'EnricoMi' description: 'A GitHub Action that publishes test results on GitHub' @@ -146,7 +146,7 @@ runs: id: test-results run: | echo '##[group]Publish Test Results' - python3 $GITHUB_ACTION_PATH/../python/publish_unit_test_results.py + python3 $GITHUB_ACTION_PATH/../python/publish_test_results.py echo '##[endgroup]' env: GITHUB_TOKEN: ${{ inputs.github_token }} diff --git a/python/publish_unit_test_results.py b/python/publish_test_results.py similarity index 100% rename from python/publish_unit_test_results.py rename to python/publish_test_results.py diff --git a/python/test/test_action_script.py b/python/test/test_action_script.py index 15db7ce5..0dde29ea 100644 --- a/python/test/test_action_script.py +++ b/python/test/test_action_script.py @@ -16,7 +16,7 @@ pull_request_build_modes, punctuation_space from publish.github_action import GithubAction from publish.unittestresults import ParsedUnitTestResults, ParseError -from publish_unit_test_results import get_conclusion, get_commit_sha, get_var, \ +from publish_test_results import get_conclusion, get_commit_sha, get_var, \ check_var, check_var_condition, deprecate_var, deprecate_val, log_parse_errors, \ get_settings, get_annotations_config, Settings, get_files, throttle_gh_request_raw, is_float, parse_files, main from test_utils import chdir @@ -530,7 +530,7 @@ def do_test_get_settings(self, # its true behaviour is tested in get_annotations_config* annotations_config = options.get('CHECK_RUN_ANNOTATIONS').split(',') \ if options.get('CHECK_RUN_ANNOTATIONS') is not None else [] - with mock.patch('publish_unit_test_results.get_annotations_config', return_value=annotations_config) as m: + with mock.patch('publish_test_results.get_annotations_config', return_value=annotations_config) as m: if gha is None: gha = mock.MagicMock() @@ -793,7 +793,7 @@ def test_get_files_include_and_exclude(self): self.assertEqual(['file2.txt'], sorted(files)) def test_get_files_with_mock(self): - with mock.patch('publish_unit_test_results.glob') as m: + with mock.patch('publish_test_results.glob') as m: files = get_files('*.txt\n!file1.txt') self.assertEqual([], files) self.assertEqual([mock.call('*.txt', recursive=True), mock.call('file1.txt', recursive=True)], m.call_args_list) @@ -881,7 +881,7 @@ def test_throttle_gh_request_raw(self): throttled_method = throttle_gh_request_raw(2, 5, method) def test_request(verb: str, expected_sleep: Optional[float]): - with mock.patch('publish_unit_test_results.time.sleep') as sleep: + with mock.patch('publish_test_results.time.sleep') as sleep: response = throttled_method('cnx', verb, 'url', 'headers', 'input') self.assertEqual('response', response) @@ -953,7 +953,7 @@ def do_raise(*args): # if this is raised, the tested main method did not return where expected but continued raise RuntimeError('This is not expected to be called') - with mock.patch('publish_unit_test_results.get_files') as m: + with mock.patch('publish_test_results.get_files') as m: m.side_effect = do_raise main(settings, gha) @@ -999,7 +999,7 @@ def test_deprecate_var(self): deprecate_var('set', 'deprecated_var', 'replacement', gha) gha.warning.assert_called_once_with('Option deprecated_var is deprecated! replacement') - with mock.patch('publish_unit_test_results.logger') as l: + with mock.patch('publish_test_results.logger') as l: deprecate_var('set', 'deprecated_var', 'replacement', None) l.warning.assert_called_once_with('Option deprecated_var is deprecated! replacement') @@ -1014,7 +1014,7 @@ def test_deprecate_val(self): deprecate_val('deprecated', 'deprecated_var', {'deprecated': 'replace'}, gha) gha.warning.assert_called_once_with('Value "deprecated" for option deprecated_var is deprecated! Instead, use value "replace".') - with mock.patch('publish_unit_test_results.logger') as l: + with mock.patch('publish_test_results.logger') as l: deprecate_val('deprecated', 'deprecated_var', {'deprecated': 'replace'}, gha) l.assert_not_called() diff --git a/python/test/test_github.py b/python/test/test_github.py index 8f700bf8..baaeb029 100644 --- a/python/test/test_github.py +++ b/python/test/test_github.py @@ -12,7 +12,7 @@ import requests.exceptions from flask import Flask, Response -from publish_unit_test_results import get_github +from publish_test_results import get_github from publish.github_action import GithubAction