From 6490214a978a0080a1e4798ea32387f130600883 Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Sun, 9 Apr 2023 01:21:30 -0400 Subject: [PATCH 1/3] Fixing tests and remove python36 tests. --- .github/workflows/build.yaml | 14 +++++++------- build/centos7-puppet6/Dockerfile.kitchen | 2 +- manifests/test/fullinstall_python36.pp | 10 ---------- test/unit/test_tasks_key_decrypt.py | 15 +++++++++++++++ 4 files changed, 23 insertions(+), 18 deletions(-) delete mode 100644 manifests/test/fullinstall_python36.pp create mode 100644 test/unit/test_tasks_key_decrypt.py diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 248ab851..c7334772 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -20,15 +20,15 @@ jobs: fail-fast: false matrix: include: - # note: actions/setup-ruby only allows using a major.minor release of ruby + # note: ruby/setup-ruby only allows using a major.minor release of ruby - ruby: '2.7' puppet: "7.0" check: "check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint" name: 'static' - - ruby: '2.5' - puppet: "6.0" - check: "parallel_spec" - name: 'spec' + # - ruby: '2.7' + # puppet: "6.0" + # check: "parallel_spec" + # name: 'spec' - ruby: '2.7' puppet: "7.0" check: "parallel_spec" @@ -44,7 +44,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - name: Setup Ruby - uses: actions/setup-ruby@v1 + uses: ruby/setup-ruby@v1 with: ruby-version: '${{ matrix.ruby }}' - name: Bundle prep @@ -139,7 +139,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - name: Setup Ruby - uses: actions/setup-ruby@v1 + uses: ruby/setup-ruby@v1 with: ruby-version: '${{ matrix.ruby }}' - name: Bundle prep diff --git a/build/centos7-puppet6/Dockerfile.kitchen b/build/centos7-puppet6/Dockerfile.kitchen index 2e3573d1..7cbcea64 100644 --- a/build/centos7-puppet6/Dockerfile.kitchen +++ b/build/centos7-puppet6/Dockerfile.kitchen @@ -16,7 +16,7 @@ RUN chmod 0600 /home/<%= @username %>/.ssh/authorized_keys RUN echo '<%= IO.read(@public_key).strip %>' >> /home/<%= @username %>/.ssh/authorized_keys # upgrade the image, otherwise installing st2 package hangs -RUN yum -y upgrade +RUN yum -y upgrade --exclude=openssh* # install doc files (/usr/share/docs) when installing yum packages # otherwise /usr/share/docs/st2/conf/nginx/st2.conf won't be present diff --git a/manifests/test/fullinstall_python36.pp b/manifests/test/fullinstall_python36.pp deleted file mode 100644 index 4d3398f5..00000000 --- a/manifests/test/fullinstall_python36.pp +++ /dev/null @@ -1,10 +0,0 @@ -# Test for installing standalone StackStorm using Python 3.8 -$st2_python_version = $facts['os']['family'] ? { - 'RedHat' => '3.6', - 'Debian' => 'python3.6', - default => '3.6', -} -class { 'st2': - python_version => $st2_python_version, -} -include st2::profile::fullinstall diff --git a/test/unit/test_tasks_key_decrypt.py b/test/unit/test_tasks_key_decrypt.py new file mode 100644 index 00000000..1e007c16 --- /dev/null +++ b/test/unit/test_tasks_key_decrypt.py @@ -0,0 +1,15 @@ +from test.unit.st2_test_case import St2TestCase +# import mock +import os +import sys + +sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'tasks')) +from key_decrypt import AESKey + + +class AESKeyTestCase(St2TestCase): + __test__ = True + + def test_init(self): + task = AESKey('test', 'test', 256) + self.assertIsInstance(task, object) \ No newline at end of file From c5b3d188044021f3f9cc17b84a69c075f6b24a82 Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Sun, 9 Apr 2023 01:29:36 -0400 Subject: [PATCH 2/3] Fixing make file and syntax with redis. --- Makefile | 2 +- manifests/profile/redis.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index be6ee538..dc31b6b3 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ THIS_FILE := $(lastword $(MAKEFILE_LIST)) ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) CI_REPO_PATH ?= $(ROOT_DIR)/ci -CI_REPO_BRANCH ?= master +CI_REPO_BRANCH ?= hotfix/code-coverage .PHONY: all all: .DEFAULT diff --git a/manifests/profile/redis.pp b/manifests/profile/redis.pp index e313af85..ade37729 100644 --- a/manifests/profile/redis.pp +++ b/manifests/profile/redis.pp @@ -18,7 +18,7 @@ class { 'redis': bind => $bind_ip, - manage_repo => $redis_manage_repo + manage_repo => $redis_manage_repo, } contain redis From c83e1e44add1d311f54768e1461a147c546742c6 Mon Sep 17 00:00:00 2001 From: Bradley Bishop Date: Sun, 9 Apr 2023 01:32:08 -0400 Subject: [PATCH 3/3] Fixing python syntax --- test/unit/test_tasks_key_decrypt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/test_tasks_key_decrypt.py b/test/unit/test_tasks_key_decrypt.py index 1e007c16..51959333 100644 --- a/test/unit/test_tasks_key_decrypt.py +++ b/test/unit/test_tasks_key_decrypt.py @@ -2,9 +2,9 @@ # import mock import os import sys +from key_decrypt import AESKey sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'tasks')) -from key_decrypt import AESKey class AESKeyTestCase(St2TestCase): @@ -12,4 +12,4 @@ class AESKeyTestCase(St2TestCase): def test_init(self): task = AESKey('test', 'test', 256) - self.assertIsInstance(task, object) \ No newline at end of file + self.assertIsInstance(task, object)