diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b29b925a5..17cf20258 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,91 +1,22 @@ --- -name: CI + # Managed by modulesync - DO NOT EDIT + # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ -on: pull_request + name: CI -concurrency: - group: ${{ github.ref_name }} - cancel-in-progress: true + # yamllint disable-line rule:truthy + on: + pull_request: {} + push: + branches: + - main + - master -jobs: - setup_matrix: - name: 'Setup Test Matrix' - runs-on: ubuntu-latest - timeout-minutes: 40 - outputs: - puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }} - puppet_beaker_test_matrix: ${{ steps.get-outputs.outputs.puppet_beaker_test_matrix }} - env: - BUNDLE_WITHOUT: development:system_tests:release - PUPPET_GEM_VERSION: ">= 7.0" - steps: - - uses: actions/checkout@v4 - - name: Setup ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.3' - bundler-cache: true - - name: Run static validations - run: bundle exec rake validate lint check - - name: Run rake rubocop - run: bundle exec rake rubocop - - name: Setup Test Matrix - id: get-outputs - run: bundle exec metadata2gha --pidfile-workaround false --domain example.com + concurrency: + group: ${{ github.ref_name }} + cancel-in-progress: true - unit: - needs: setup_matrix - runs-on: ubuntu-latest - timeout-minutes: 40 - strategy: - fail-fast: false - matrix: - include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}} - env: - BUNDLE_WITHOUT: development:system_tests:release - PUPPET_VERSION: "~> ${{ matrix.puppet }}.0" - name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }}) - steps: - - uses: actions/checkout@v4 - - name: Setup ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - name: Run tests - run: bundle exec rake parallel_spec - - acceptance: - needs: setup_matrix - runs-on: ubuntu-20.04 - env: - BUNDLE_WITHOUT: development:test:release - strategy: - fail-fast: false - matrix: - include: ${{fromJson(needs.setup_matrix.outputs.puppet_beaker_test_matrix)}} - name: "${{ matrix.name }}" - steps: - - uses: actions/checkout@v4 - - name: Setup ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.3' - bundler-cache: true - - name: Start squid - run: ./scripts/start-squid.sh - - name: Run tests - run: bundle exec rake beaker - env: ${{ matrix.env }} - - name: squid logs - run: docker logs squid --tail 50 - if: always() - - tests: - needs: - - unit - - acceptance - runs-on: ubuntu-latest - name: Test suite - steps: - - run: echo Test suite completed + jobs: + puppet: + name: Puppet + uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v3 diff --git a/.sync.yml b/.sync.yml index 5ed009530..3c4892069 100644 --- a/.sync.yml +++ b/.sync.yml @@ -1,5 +1,3 @@ --- spec/spec_helper.rb: spec_overrides: "require 'spec_helper_methods'" -.github/workflows/ci.yml: - unmanaged: true diff --git a/scripts/start-squid.sh b/scripts/start-squid.sh deleted file mode 100755 index 5f8751fba..000000000 --- a/scripts/start-squid.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -cat << EOF > /tmp/squid.conf -http_port 3128 -http_access allow all -logfile_rotate 0 -cache_log stdio:/dev/stdout -access_log stdio:/dev/stdout -cache_store_log stdio:/dev/stdout -EOF - -docker run --detach --rm \ - --name squid \ - --hostname squid \ - --publish 3128:3128 \ - --env='SQUID_CONFIG_FILE=/etc/squid/my-squid.conf' \ - --volume=/tmp/squid.conf:/etc/squid/my-squid.conf:ro \ - b4tman/squid - -sleep 3 -docker logs squid --tail 100 - -docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' squid > ~/SQUID_IP diff --git a/spec/acceptance/node_exporter_spec.rb b/spec/acceptance/node_exporter_spec.rb index f8c13f0db..b5605e46b 100644 --- a/spec/acceptance/node_exporter_spec.rb +++ b/spec/acceptance/node_exporter_spec.rb @@ -54,25 +54,6 @@ it { is_expected.to be_enabled } end - describe port(9100) do - it { is_expected.to be_listening.with('tcp6') } - end - end - # rubocop:enable RSpec/RepeatedExampleGroupBody,RSpec/RepeatedExampleGroupDescription - - describe 'install with proxy' do - it 'installs idempotently with no errors' do - pp = "class{'prometheus::node_exporter': proxy_server => 'http://squid:3128', proxy_type => 'http'}" - # Run it twice and test for idempotency - apply_manifest(pp, catch_failures: true) - apply_manifest(pp, catch_changes: true) - end - - describe service(service_name) do - it { is_expected.to be_running } - it { is_expected.to be_enabled } - end - describe port(9100) do it { is_expected.to be_listening.with('tcp6') } end