From 13130a64fd0e1eba3b4d70fcdaea3d1d17b7c549 Mon Sep 17 00:00:00 2001 From: bronachfalls Date: Fri, 18 Sep 2026 14:02:15 +0100 Subject: [PATCH] Add CODECOV_TOKEN and fix Windows false-positive in get_calls_spec - Add CODECOV_TOKEN to linux_tests env in ci.yml so the codecov gem (already present in the :tests Gemfile group and wired up via puppetlabs_spec_helper/module_spec_helper) has a token to upload coverage results with. - Narrow the /Creating/ regex in get_calls_spec.rb to /\]: Creating/ to avoid a false positive on Windows where Puppet emits "Info: Creating state file ..." at the end of every run. The broader regex matched that unrelated message, causing the test to fail even when no resources were actually being created. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/ci.yml | 1 + spec/acceptance/get_calls_spec.rb | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97163c33..ac57e1c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ jobs: - {puppet_version: '8', ruby: 'jruby-9.4.2.0'} env: PUPPET_GEM_VERSION: ~> ${{ matrix.cfg.puppet_version }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} steps: - name: Checkout current PR uses: actions/checkout@v4 diff --git a/spec/acceptance/get_calls_spec.rb b/spec/acceptance/get_calls_spec.rb index 2672e49d..27331cfc 100644 --- a/spec/acceptance/get_calls_spec.rb +++ b/spec/acceptance/get_calls_spec.rb @@ -20,14 +20,14 @@ stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"test_get_calls_basic { foo: } test_get_calls_basic { bar: }\"") expect(stdout_str).to match(/Notice: test_get_calls_basic: Provider get called 1 times/) expect(stdout_str).not_to match(/Notice: test_get_calls_basic: Provider get called 2 times/) - expect(stdout_str).not_to match(/Creating/) + expect(stdout_str).not_to match(/\]: Creating/) end it 'calls get 1 time with resource purging' do stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"test_get_calls_basic { foo: } test_get_calls_basic { bar: } resources { test_get_calls_basic: purge => true }\"") expect(stdout_str).to match(/Notice: test_get_calls_basic: Provider get called 1 times/) expect(stdout_str).not_to match(/Notice: test_get_calls_basic: Provider get called 2 times/) - expect(stdout_str).not_to match(/Creating/) + expect(stdout_str).not_to match(/\]: Creating/) end end @@ -46,14 +46,14 @@ expect(stdout_str).to match(/Notice: test_get_calls_sgf: Provider get called 1 times/) expect(stdout_str).to match(/Notice: test_get_calls_sgf: Provider get called 2 times/) expect(stdout_str).not_to match(/Notice: test_get_calls_sgf: Provider get called 3 times/) - expect(stdout_str).not_to match(/Creating/) + expect(stdout_str).not_to match(/\]: Creating/) end it 'calls get 1 time when resource purging' do stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"test_get_calls_sgf { foo: } test_get_calls_sgf { bar: } resources { test_get_calls_sgf: purge => true }\"") expect(stdout_str).to match(/Notice: test_get_calls_sgf: Provider get called 1 times/) expect(stdout_str).not_to match(/Notice: test_get_calls_sgf: Provider get called 2 times/) - expect(stdout_str).not_to match(/Creating/) + expect(stdout_str).not_to match(/\]: Creating/) end end end