Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing pipleine #242

Merged
merged 25 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .expeditor/buildkite/artifact.habitat.test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion .expeditor/buildkite/artifact.habitat.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .expeditor/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .expeditor/habitat-test.pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 9 additions & 5 deletions habitat/tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Loading