Skip to content

Commit

Permalink
remove ruby 2 tests and update lookup spec tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alex501212 committed Nov 6, 2024
1 parent 0b92e55 commit 9990d84
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
ruby: [2.7, 3.1]
ruby: [3.1]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bolt_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
ruby: [2.7, 3.1]
ruby: [3.1]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bolt_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
ruby: [2.7, 3.1]
ruby: [3.1]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker_transport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [2.7, 3.1]
ruby: [3.1]
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [2.7, 3.1]
ruby: [3.1]
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/local_transport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
ruby: [2.7, 3.1]
ruby: [3.1]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/modules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [2.7, 3.1]
ruby: [3.1]
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/orch_transport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
ruby: [2.7, 3.1]
ruby: [3.1]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ssh_transport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [2.7, 3.1]
ruby: [3.1]
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
ruby: [2.7, 3.1]
ruby: [3.1]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
ruby: [2.7, 3.1]
ruby: [3.1]
env:
WINDOWS_AGENTS: true
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/winrm_transport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
ruby: [2.7, 3.1]
ruby: [3.1]
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down
19 changes: 8 additions & 11 deletions spec/integration/lookup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,12 @@
end
end

context 'with interpolations' do
context 'when context is not available' do
let(:hiera_config) { File.join(project, 'hiera_interpolations.yaml') }

it 'returns an error' do
it 'returns the default value' do
result = run_cli_json(cli_command + %w[key=test::interpolations])
expect(result).to include(
'kind' => 'bolt/pal-error',
'msg' => /Interpolations are not supported in lookups/
)
expect(result).to eq('test::interpolations data/common.yaml')
end
end

Expand Down Expand Up @@ -159,11 +156,11 @@
let(:plan) { 'test::plan_lookup' }
let(:uri) { 'localhost' }

it 'raises a validation error' do
it 'errors with a missing key' do
result = run_cli_json(cli_command + %W[-t #{uri}])
expect(result).to include(
'kind' => 'bolt/pal-error',
'msg' => /Interpolations are not supported in lookups/
'msg' => "Function lookup() did not find a value for the name 'pop'"
)
end
end
Expand Down Expand Up @@ -307,9 +304,9 @@
context 'with invalid plan_hierarchy' do
let(:hiera_config) { File.join(project, 'plan_hiera_facts.yaml') }

it 'raises a validation error' do
expect { run_cli_json(%w[lookup environment] + opts) }
.to raise_error(Bolt::PAL::PALError, /Interpolations are not supported in lookups/)
it 'returns the default value' do
result = run_cli_json(%w[lookup environment] + opts)
expect(result).to eq("environment data/common.yaml")
end
end

Expand Down

0 comments on commit 9990d84

Please sign in to comment.