diff --git a/.expeditor/buildkite/artifact.habitat.test.ps1 b/.expeditor/buildkite/artifact.habitat.test.ps1 index adeb59f6..209c4c83 100755 --- a/.expeditor/buildkite/artifact.habitat.test.ps1 +++ b/.expeditor/buildkite/artifact.habitat.test.ps1 @@ -78,7 +78,7 @@ Push-Location $project_root try { Write-Host "Running unit tests..." - /habitat/tests/test.ps1 $pkg_ident + habitat/tests/test.ps1 $pkg_ident } finally { # Ensure we always return to the original directory diff --git a/.expeditor/buildkite/artifact.habitat.test.sh b/.expeditor/buildkite/artifact.habitat.test.sh index 6ded1be3..fb195d1d 100755 --- a/.expeditor/buildkite/artifact.habitat.test.sh +++ b/.expeditor/buildkite/artifact.habitat.test.sh @@ -54,7 +54,6 @@ if [ -f ./results/last_build.env ]; then . ./results/last_build.env export pkg_artifact fi - echo "+++ Installing ${pkg_ident:?is undefined}" echo "++++" echo $project_root diff --git a/.expeditor/config.yml b/.expeditor/config.yml index 29da699e..bc11f923 100644 --- a/.expeditor/config.yml +++ b/.expeditor/config.yml @@ -12,6 +12,8 @@ rubygems: release_branches: - workstation-LTS: version_constraint: 5.* + - main: + version_constraint: 5.* github: # This deletes the GitHub PR branch after successfully merged into the release branch delete_branch_on_merge: true diff --git a/.expeditor/habitat-test.pipeline.yml b/.expeditor/habitat-test.pipeline.yml index 98d8b936..a8636693 100644 --- a/.expeditor/habitat-test.pipeline.yml +++ b/.expeditor/habitat-test.pipeline.yml @@ -7,11 +7,12 @@ expeditor: automatic: limit: 1 + steps: - label: ":linux: Validate Habitat Builds of Chef-cli" commands: - - habitat/tests/test.sh + - .expeditor/buildkite/artifact.habitat.test.sh expeditor: executor: docker: diff --git a/habitat/tests/test.sh b/habitat/tests/test.sh index 72e288a4..d5d01cdc 100755 --- a/habitat/tests/test.sh +++ b/habitat/tests/test.sh @@ -18,9 +18,13 @@ error () { package_version=$(awk -F / '{print $3}' <<<"$pkg_ident") cd "${project_root}" - -echo "--- :mag_right: Testing ${pkg_ident} executables" -actual_version=$(hab pkg exec "${pkg_ident}" chef-cli -v | sed -E 's/.*version: ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') -[[ "$package_version" = "$actual_version" ]] || error "chef-cli version is not the expected version. Expected '$package_version', got '$actual_version'" - +echo "Testing ${pkg_ident} executables" +version=$(hab pkg exec "${pkg_ident}" chef-cli -v) +echo $version +actual_version=$(echo "$version" | sed -E 's/.*version: ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') +echo $actual_version + +if [[ "$actual_version" != *"$package_version"* ]]; then + error "chef-cli version is not the expected version. Expected '$package_version', got '$actual_version'" +fi