From a7ae5f57ed610d13ee05a5f69e63481042ddeeb1 Mon Sep 17 00:00:00 2001 From: jordanbreen28 Date: Mon, 8 Jan 2024 13:34:07 +0000 Subject: [PATCH] (CAT-1618) - Add code coverage to ci --- .github/workflows/ci.yml | 4 ++++ .../spec/package/support/serverspec_monkeypatch.rb | 2 +- spec/unit/pdk/config/namespace_spec.rb | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b155d088f..cf8915161 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,9 @@ on: - "main" workflow_dispatch: +env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + jobs: spec: @@ -19,6 +22,7 @@ jobs: uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main" secrets: "inherit" with: + rake_task: 'spec:coverage' ruby_version: ${{ matrix.ruby_version }} acceptance: diff --git a/package-testing/spec/package/support/serverspec_monkeypatch.rb b/package-testing/spec/package/support/serverspec_monkeypatch.rb index 380d4e97c..39b594916 100644 --- a/package-testing/spec/package/support/serverspec_monkeypatch.rb +++ b/package-testing/spec/package/support/serverspec_monkeypatch.rb @@ -14,7 +14,7 @@ def run option_keys << :cwd option_keys << :run_as -Specinfra::Configuration.singleton_class.send(:remove_const, :VALID_OPTIONS_KEYS) +Specinfra::Configuration.singleton_class.send(:remove_const, :VALID_OPTIONS_KEYS) # rubocop:disable RSpec/RemoveConst Specinfra::Configuration.singleton_class.const_set(:VALID_OPTIONS_KEYS, option_keys.freeze) RSpec.configuration.add_setting :cwd RSpec.configuration.add_setting :run_as diff --git a/spec/unit/pdk/config/namespace_spec.rb b/spec/unit/pdk/config/namespace_spec.rb index 5d44a6226..ed8066a95 100644 --- a/spec/unit/pdk/config/namespace_spec.rb +++ b/spec/unit/pdk/config/namespace_spec.rb @@ -144,7 +144,7 @@ def spec_simple_validator expect([config.fetch(:foo, 'default'), config.fetch('foo', 'default')]).to all(eq('bar')) end - it 'will return the specified default value for unknown values' do + it 'returns the specified default value for unknown values' do expect([config.fetch(:missing, 'default'), config.fetch('missing', 'default')]).to all(eq('default')) end