Skip to content

Commit ba61717

Browse files
committed
(maint) Install openvoxdb-termini from openvoxdb dir in artifacts
There's a peculiarity in openvoxdb-termini pathing on the artifacts server (it's in the openvoxdb directory rather than its own openvoxdb-termini directory) so I've special cased the pathing in set_artifacts_package_url() for that case and am expanding the coverage to include openvoxdb and openvoxdb-termini to expose the issue and provide validation that these packages can also be obtained from artifacts.
1 parent 6132913 commit ba61717

File tree

3 files changed

+45
-7
lines changed

3 files changed

+45
-7
lines changed

.github/workflows/pr_testing_install_build_artifact.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ jobs:
7676
test-install-build-artifact-task-noarch:
7777
strategy:
7878
matrix:
79+
package:
80+
- name: openvox-server
81+
version: 8.8.0
82+
- name: openvoxdb
83+
version: 8.9.0
84+
- name: openvoxdb-termini
85+
version: 8.9.0
7986
details:
8087
- image: almalinux:9
8188
prereqs:
@@ -124,12 +131,15 @@ jobs:
124131
- name: Test noarch package installation
125132
env:
126133
PT__installdir: ${{ github.workspace }}
127-
PT_package: "openvox-server"
128-
PT_version: "8.8.0"
134+
PT_package: ${{ matrix.package.name }}
135+
PT_version: ${{ matrix.package.version }}
129136
run: ./openvox_bootstrap/tasks/install_build_artifact_linux.sh
130137
- name: Verify openvox-server is installed
131138
shell: bash
139+
env:
140+
PACKAGE: ${{ matrix.package.name }}
141+
VERSION: ${{ matrix.package.version }}
132142
run: |-
133-
/opt/puppetlabs/bin/puppet resource package openvox-server > openvox-server.status
134-
cat openvox-server.status
135-
grep "ensure.*=>.*'8.8.0" openvox-server.status
143+
/opt/puppetlabs/bin/puppet resource package "${PACKAGE}" > openvox-package.status
144+
cat openvox-package.status
145+
grep "ensure.*=>.*'${VERSION}" openvox-package.status

files/common.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,17 @@ set_artifacts_package_url() {
493493
fail "Unhandled package type: '${package_type}'"
494494
;;
495495
esac
496-
package_url="${_artifacts_source}/${_package}/${_version}/${package_name}"
496+
497+
case "${_package}" in
498+
openvoxdb-termini)
499+
local _package_dir='openvoxdb'
500+
;;
501+
*)
502+
local _package_dir="${_package}"
503+
;;
504+
esac
505+
506+
package_url="${_artifacts_source}/${_package_dir}/${_version}/${package_name}"
497507

498508
export package_name # quiets shellcheck SC2034
499509
assigned 'package_name'

spec/unit/bash/common_sh_spec.rb

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@
544544
expect(status.success?).to be(true)
545545
package_name = 'openvoxdb-termini-8.9.1-1.el.noarch.rpm'
546546
expect(output).to include("Assigned package_name=#{package_name}")
547-
expect(output).to include("Assigned package_url=https://foo/openvoxdb-termini/8.9.1/#{package_name}")
547+
expect(output).to include("Assigned package_url=https://foo/openvoxdb/8.9.1/#{package_name}")
548548
end
549549

550550
it 'builds a fedora url' do
@@ -558,5 +558,23 @@
558558
expect(output).to include("Assigned package_url=https://foo/openvox-agent/8.18.0/#{package_name}")
559559
end
560560
end
561+
562+
context 'pathing' do
563+
it 'looks for openvoxdb in the openvoxdb dir' do
564+
allow_script.to set_env('os_family', 'el')
565+
output, status = test('set_artifacts_package_url https://foo openvoxdb 8.9.1')
566+
567+
expect(status.success?).to be(true)
568+
expect(output).to match(%r{Assigned package_url=https://foo/openvoxdb/8\.9\.1/})
569+
end
570+
571+
it 'lookds for openvoxdb-termini in the openvoxdb dir as well' do
572+
allow_script.to set_env('os_family', 'el')
573+
output, status = test('set_artifacts_package_url https://foo openvoxdb-termini 8.9.1')
574+
575+
expect(status.success?).to be(true)
576+
expect(output).to match(%r{Assigned package_url=https://foo/openvoxdb/8\.9\.1/})
577+
end
578+
end
561579
end
562580
end

0 commit comments

Comments
 (0)