Skip to content

Commit

Permalink
use default modulesync tremplate for ci.yml
Browse files Browse the repository at this point in the history
The custom squid setup is actually not needed. The removed test even works without that
workaround. Since no other acceptance test actually test the install with a custom
proxy I removed the test entirely.

fixes #829
  • Loading branch information
TheMeier committed Dec 30, 2024
1 parent b2650aa commit abeddaf
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 134 deletions.
103 changes: 17 additions & 86 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---
spec/spec_helper.rb:
spec_overrides: "require 'spec_helper_methods'"
.github/workflows/ci.yml:
unmanaged: true
23 changes: 0 additions & 23 deletions scripts/start-squid.sh

This file was deleted.

18 changes: 0 additions & 18 deletions spec/acceptance/node_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,4 @@
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
end
end
5 changes: 0 additions & 5 deletions spec/setup_acceptance_node.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
file_line { '/etc/hosts-squid':
path => '/etc/hosts',
line => "${facts['squid_ip']} squid",
}

if $facts['os']['family'] == 'Debian' {
package { 'apt-transport-https':
ensure => 'installed',
Expand Down

0 comments on commit abeddaf

Please sign in to comment.