From 87197f3c7c7f611f0cb669848f1799e9e19f607e Mon Sep 17 00:00:00 2001 From: Corey Hemminger Date: Fri, 21 Jun 2024 12:09:16 -0500 Subject: [PATCH 1/5] fix: release please configs Signed-off-by: Corey Hemminger --- .github/workflows/{ci.yml => lint.yml} | 32 ++++++++++++-------------- .github/workflows/publish.yaml | 5 +--- .markdownlint.yaml | 8 +++---- .release-please-manifest.json | 3 +++ kitchen.yml | 12 ++++------ release-please-config.json | 12 ++++++++++ 6 files changed, 39 insertions(+), 33 deletions(-) rename .github/workflows/{ci.yml => lint.yml} (73%) create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/ci.yml b/.github/workflows/lint.yml similarity index 73% rename from .github/workflows/ci.yml rename to .github/workflows/lint.yml index 4722f33..4d15274 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/lint.yml @@ -1,34 +1,33 @@ --- -name: Lint & Unit +name: 'Lint, Unit & Integration Tests' "on": pull_request: jobs: lint-unit: - uses: test-kitchen/.github/.github/workflows/lint-unit.yml@v0.1.2 + uses: test-kitchen/.github/.github/workflows/lint-unit.yml@main integration-windows: - name: Windows ${{matrix.suite}} ${{matrix.os}} runs-on: windows-latest needs: lint-unit strategy: fail-fast: false matrix: suite: [default] - os: [ubuntu-20.04] + os: [ubuntu-24.04] + ruby: ["3.3"] steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.1" + ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }} integration-linux: - name: Linux ${{matrix.suite}} ${{matrix.os}} runs-on: ubuntu-latest needs: lint-unit strategy: @@ -41,22 +40,21 @@ jobs: - amd64 - inspec os: - - amazonlinux-2 - - ubuntu-1804 - - ubuntu-2004 + - amazonlinux-2023 + - ubuntu-2204 + - ubuntu-2404 - fedora-latest - - centos-7 - - oraclelinux-7 - - rockylinux-8 - - debian-11 + - almalinux-9 + - rockylinux-9 - debian-12 - opensuse-15 - dockerfile + ruby: ["3.3"] steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.1" + ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -65,7 +63,6 @@ jobs: - run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }} integration-capabilities: - name: Linux ${{matrix.suite}} ${{matrix.os}} runs-on: ubuntu-latest needs: lint-unit strategy: @@ -73,12 +70,13 @@ jobs: matrix: suite: - capabilities - os: [debian-11, ubuntu-1804, ubuntu-2004] + os: [debian-12, ubuntu-2204, ubuntu-2404] + ruby: ["3.3"] steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.1" + ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 37c5e5c..d47a1b2 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -9,12 +9,9 @@ jobs: release-please: runs-on: ubuntu-latest steps: - - uses: google-github-actions/release-please-action@v3 + - uses: googleapis/release-please-action@v4 id: release with: - release-type: ruby - package-name: kitchen-docker - version-file: lib/kitchen/driver/docker_version.rb token: ${{ secrets.PORTER_GITHUB_TOKEN }} - name: Checkout diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 5df560a..9fd2375 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,8 +1,6 @@ +--- default: true +MD004: false +MD012: false MD013: false MD024: false -MD026: false -MD036: false -MD012: false -MD029: false -MD004: false diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..d4f6f29 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "3.0.0" +} diff --git a/kitchen.yml b/kitchen.yml index 94bf41e..9d95c6c 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -13,18 +13,16 @@ provisioner: name: dummy platforms: - - name: amazonlinux-2 - - name: ubuntu-18.04 - - name: ubuntu-20.04 + - name: amazonlinux-2023 + - name: ubuntu-22.04 + - name: ubuntu-24.04 - name: fedora-latest driver: provision_command: - yum install libxcrypt-compat -y - curl -L https://www.chef.io/chef/install.sh | bash - - name: centos-7 - - name: oraclelinux-7 - - name: rockylinux-8 - - name: debian-11 + - name: almalinux-9 + - name: rockylinux-9 - name: debian-12 - name: opensuse-15 driver: diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..2cad467 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,12 @@ +{ + "packages": { + ".": { + "package-name": "kitchen-docker", + "changelog-path": "CHANGELOG.md", + "release-type": "ruby", + "include-component-in-tag": false, + "version-file": "lib/kitchen/docker/docker_version.rb" + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" +} From 574395c232139da5b9cd706d7cf9bd009452cc1e Mon Sep 17 00:00:00 2001 From: Corey Hemminger Date: Fri, 21 Jun 2024 12:10:12 -0500 Subject: [PATCH 2/5] add codeowners Signed-off-by: Corey Hemminger --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..b7175b0 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +@test-kitchen/maintainers From 61bf9360a53d86efa7659f89db5a776ce32ee504 Mon Sep 17 00:00:00 2001 From: Corey Hemminger Date: Fri, 21 Jun 2024 12:36:16 -0500 Subject: [PATCH 3/5] test Signed-off-by: Corey Hemminger --- kitchen.windows.yml | 2 +- kitchen.yml | 2 +- lib/docker/version.rb | 24 +++++++++---------- test/Dockerfile | 2 +- .../default/disabled/default_spec.rb | 12 +++++----- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/kitchen.windows.yml b/kitchen.windows.yml index ef520bd..187482e 100644 --- a/kitchen.windows.yml +++ b/kitchen.windows.yml @@ -18,7 +18,7 @@ provisioner: platforms: - name: windows driver_config: - image: mcr.microsoft.com/windows/servercore:1809 + image: mcr.microsoft.com/windows/servercore:ltsc2022 platform: windows suites: diff --git a/kitchen.yml b/kitchen.yml index 9d95c6c..b757841 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -40,7 +40,7 @@ suites: driver: build_context: false - name: capabilities - includes: [debian-11, ubuntu-18.04, ubuntu-20.04] + includes: [debian-12, ubuntu-22.04, ubuntu-24.04] driver: provision_command: - curl -L https://www.chef.io/chef/install.sh | bash diff --git a/lib/docker/version.rb b/lib/docker/version.rb index 1b4cb1c..257add8 100644 --- a/lib/docker/version.rb +++ b/lib/docker/version.rb @@ -11,15 +11,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -begin - require "docker" - - # Override API_VERSION constant in docker-api gem to use version 1.24 of the Docker API - # This override is for the docker-api gem to communicate to the Docker engine on Windows - module Docker - VERSION = "0.0.0".freeze - API_VERSION = "1.24".freeze - end -rescue LoadError => e - logger.debug("[Docker] docker-api gem not found for InSpec verifier. #{e}") -end +# begin +# require "docker" +# +# # Override API_VERSION constant in docker-api gem to use version 1.24 of the Docker API +# # This override is for the docker-api gem to communicate to the Docker engine on Windows +# module Docker +# VERSION = "0.0.0".freeze +# API_VERSION = "1.24".freeze +# end +# rescue LoadError => e +# logger.debug("[Docker] docker-api gem not found for InSpec verifier. #{e}") +# end diff --git a/test/Dockerfile b/test/Dockerfile index 4ecf596..5a84945 100644 --- a/test/Dockerfile +++ b/test/Dockerfile @@ -1,4 +1,4 @@ -FROM centos:7 +FROM almalinux:7 RUN yum clean all RUN yum install -y sudo openssh-server openssh-clients which curl htop RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key diff --git a/test/integration/default/disabled/default_spec.rb b/test/integration/default/disabled/default_spec.rb index 3a18256..3e55eba 100644 --- a/test/integration/default/disabled/default_spec.rb +++ b/test/integration/default/disabled/default_spec.rb @@ -14,11 +14,11 @@ # limitations under the License. # -# Disable now busser-serever is gone. -# require 'serverspec' -# require 'spec_helper' +# Disable now busser-server is gone. +require 'serverspec' +require 'spec_helper' # # Just make sure the image launched and is reachable. -# describe command('true') do -# its(:exit_status) { is_expected.to eq 0 } -# end +describe command('true') do + its(:exit_status) { is_expected.to eq 0 } +end From 28db79d75afea76315222b0f501f507cae0ee511 Mon Sep 17 00:00:00 2001 From: Corey Hemminger Date: Fri, 21 Jun 2024 12:39:31 -0500 Subject: [PATCH 4/5] test Signed-off-by: Corey Hemminger --- .github/workflows/lint.yml | 3 +++ test/integration/default/disabled/default_spec.rb | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4d15274..69ea0f4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,6 +9,7 @@ jobs: uses: test-kitchen/.github/.github/workflows/lint-unit.yml@main integration-windows: + name: Windows ${{matrix.suite}} ${{matrix.os}} runs-on: windows-latest needs: lint-unit strategy: @@ -28,6 +29,7 @@ jobs: - run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }} integration-linux: + name: Linux ${{matrix.suite}} ${{matrix.os}} runs-on: ubuntu-latest needs: lint-unit strategy: @@ -63,6 +65,7 @@ jobs: - run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }} integration-capabilities: + name: Linux ${{matrix.suite}} ${{matrix.os}} runs-on: ubuntu-latest needs: lint-unit strategy: diff --git a/test/integration/default/disabled/default_spec.rb b/test/integration/default/disabled/default_spec.rb index 3e55eba..2d0dbda 100644 --- a/test/integration/default/disabled/default_spec.rb +++ b/test/integration/default/disabled/default_spec.rb @@ -15,10 +15,10 @@ # # Disable now busser-server is gone. -require 'serverspec' -require 'spec_helper' +require "serverspec" +require "spec_helper" # # Just make sure the image launched and is reachable. -describe command('true') do +describe command("true") do its(:exit_status) { is_expected.to eq 0 } end From b1c904a774d1bd03738355c1eb9b24dd9f85d663 Mon Sep 17 00:00:00 2001 From: Corey Hemminger Date: Fri, 21 Jun 2024 14:24:27 -0500 Subject: [PATCH 5/5] test Signed-off-by: Corey Hemminger --- .github/workflows/lint.yml | 6 +++--- .release-please-manifest.json | 2 +- kitchen.yml | 2 +- lib/kitchen/transport/docker.rb | 4 ++-- test/Dockerfile | 2 +- test/integration/default/disabled/default_spec.rb | 14 +++++++------- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 69ea0f4..3d1fe49 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,7 +26,7 @@ jobs: bundler-cache: true - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }} + - run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }} -l debug integration-linux: name: Linux ${{matrix.suite}} ${{matrix.os}} @@ -62,7 +62,7 @@ jobs: uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }} + - run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }} -l debug integration-capabilities: name: Linux ${{matrix.suite}} ${{matrix.os}} @@ -83,4 +83,4 @@ jobs: bundler-cache: true - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }} + - run: bundle exec kitchen test ${{ matrix.suite }}-${{ matrix.os }} -l debug diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d4f6f29..95a37e3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.0.0" + ".": "3.2.0" } diff --git a/kitchen.yml b/kitchen.yml index b757841..87140ab 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -13,7 +13,7 @@ provisioner: name: dummy platforms: - - name: amazonlinux-2023 + - name: amazonlinux-2 - name: ubuntu-22.04 - name: ubuntu-24.04 - name: fedora-latest diff --git a/lib/kitchen/transport/docker.rb b/lib/kitchen/transport/docker.rb index 10b6e25..0119eb5 100644 --- a/lib/kitchen/transport/docker.rb +++ b/lib/kitchen/transport/docker.rb @@ -18,7 +18,7 @@ require_relative "../docker/helpers/inspec_helper" -require_relative "../../docker/version" +# require_relative "../../docker/version" require_relative "../../train/docker" module Kitchen @@ -26,7 +26,7 @@ module Transport class Docker < Kitchen::Transport::Base class DockerFailed < TransportFailed; end - kitchen_transport_api_version 1 + # kitchen_transport_api_version 1 plugin_version Kitchen::VERSION default_config :binary, "docker" diff --git a/test/Dockerfile b/test/Dockerfile index 5a84945..d9222f7 100644 --- a/test/Dockerfile +++ b/test/Dockerfile @@ -1,4 +1,4 @@ -FROM almalinux:7 +FROM almalinux:latest RUN yum clean all RUN yum install -y sudo openssh-server openssh-clients which curl htop RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key diff --git a/test/integration/default/disabled/default_spec.rb b/test/integration/default/disabled/default_spec.rb index 2d0dbda..cd48e09 100644 --- a/test/integration/default/disabled/default_spec.rb +++ b/test/integration/default/disabled/default_spec.rb @@ -15,10 +15,10 @@ # # Disable now busser-server is gone. -require "serverspec" -require "spec_helper" - -# # Just make sure the image launched and is reachable. -describe command("true") do - its(:exit_status) { is_expected.to eq 0 } -end +# require "serverspec" +# require "spec_helper" +# +# Just make sure the image launched and is reachable. +# describe command("true") do +# its(:exit_status) { is_expected.to eq 0 } +# end