From 06249ea522283f241e655b88dd7479870d93fc22 Mon Sep 17 00:00:00 2001 From: harshilgajera-crest Date: Mon, 21 Jun 2021 18:28:37 +0530 Subject: [PATCH] test:fixing failing tests for PSA in circleci and github-actions --- .github/workflows/test_matrix.yml | 2 +- .ignore_splunk_internal_errors | 8 ++++++++ Dockerfile.tests | 4 ++-- deps/build/addonfactory_test_matrix_splunk | 2 +- tests/test_splunk_addon.py | 5 +++++ 5 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 .ignore_splunk_internal_errors diff --git a/.github/workflows/test_matrix.yml b/.github/workflows/test_matrix.yml index 5c40028b6..705cdff59 100644 --- a/.github/workflows/test_matrix.yml +++ b/.github/workflows/test_matrix.yml @@ -10,7 +10,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: [3.7] - splunk-version: [7.2, 7.3, 8.0, 8.1] + splunk-version: [8.0, 8.1, 8.2] steps: - uses: actions/checkout@v2 diff --git a/.ignore_splunk_internal_errors b/.ignore_splunk_internal_errors new file mode 100644 index 000000000..a8dd06d80 --- /dev/null +++ b/.ignore_splunk_internal_errors @@ -0,0 +1,8 @@ +message_key="" message=Could not load lookup=LOOKUP-FAIL_test_wrong_outputnew +message_key="" message=Could not load lookup=LOOKUP-FAIL_test_no_inputfield +message_key="" message=Could not load lookup=LOOKUP-FAIL_test_no_lookup +message_key="" message=Could not load lookup=LOOKUP-FAIL_test_nonexistent_lookup +message_key="" message=Could not load lookup=LOOKUP-FAIL_test_wrong_AS_field_name_output +message_key="" message=Could not load lookup=LOOKUP-FAIL_test_wrong_as_field_name_output +message_key="" message=Could not load lookup=LOOKUP-FAIL_test_wrong_output +message_key="" message=Could not load lookup=LOOKUP-PASS_test_lookup_not_found \ No newline at end of file diff --git a/Dockerfile.tests b/Dockerfile.tests index 6fc6f7fb5..c444d56e7 100644 --- a/Dockerfile.tests +++ b/Dockerfile.tests @@ -6,7 +6,7 @@ # #You should have received a copy of the CC0 legalcode along with this #work. If not, see . -FROM ubuntu:rolling +FROM ubuntu:latest RUN mkdir -p /work/tests RUN mkdir -p /work/test-results/functional @@ -20,7 +20,7 @@ RUN export DEBIAN_FRONTEND=noninteractive ;\ apt-get install -y --no-install-recommends apt-utils ;\ apt-get install -y locales ;\ localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 ;\ - apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl git + apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl git python-is-python3 python3-distutils python3-pip ENV LANG en_US.utf8 diff --git a/deps/build/addonfactory_test_matrix_splunk b/deps/build/addonfactory_test_matrix_splunk index 03cca094c..45af7cfcb 160000 --- a/deps/build/addonfactory_test_matrix_splunk +++ b/deps/build/addonfactory_test_matrix_splunk @@ -1 +1 @@ -Subproject commit 03cca094c5138b962524cd1a89408a905ebf59f7 +Subproject commit 45af7cfcb6bcfbe05f884cb065acd0f1afa21d56 diff --git a/tests/test_splunk_addon.py b/tests/test_splunk_addon.py index 764571741..93b5f8a81 100644 --- a/tests/test_splunk_addon.py +++ b/tests/test_splunk_addon.py @@ -180,6 +180,10 @@ def empty_method(): os.path.join(testdir.request.fspath.dirname, "addons/TA_broken"), os.path.join(testdir.tmpdir, "package"), ) + shutil.copy( + os.path.join(testdir.request.config.invocation_dir, ".ignore_splunk_internal_errors"), + testdir.tmpdir, + ) setup_test_dir(testdir) SampleGenerator.clean_samples() Rule.clean_rules() @@ -192,6 +196,7 @@ def empty_method(): "--search-interval=4", "--search-retry=4", "--search-index=*,_internal", + "--ignore-addon-errors=.ignore_splunk_internal_errors", ) # fnmatch_lines does an assertion internally