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

[chore] update package tests with upstream changes #279

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft
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
16 changes: 15 additions & 1 deletion .github/workflows/snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,33 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: "~1.22.6"
cache: false
- uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- uses: docker/setup-buildx-action@v3
- uses: anchore/sbom-action/[email protected]
- name: Cache tools
uses: actions/cache@v4
id: cache-tools
with:
path: .tools
key: snapshot-tools-${{ runner.os }}-${{ hashFiles('internal/tools/go.sum') }}
- name: Touch tools
- name: Install tools
if: steps.cache-tools.outputs.cache-hit != 'true'
run: |
mkdir -p .tools
touch .tools/*
make install-tools
- name: Generate source files
run: make generate
- name: Cache go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: snapshot-mods-${{ runner.os }}-${{ hashFiles('build/go.sum') }}
- name: Create Snapshot for Pull Request
run: make snapshot
- name: Upload Pull Request Preview
Expand All @@ -53,6 +66,7 @@ jobs:
runs-on: ubuntu-22.04
needs: build
strategy:
fail-fast: false
matrix:
os: ["deb", "rpm"]
arch: ["x86_64", "arm64"]
Expand Down
10 changes: 9 additions & 1 deletion internal/testbed/linux-services/package-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,20 @@ trap 'podman rm -fv $container_name >/dev/null 2>&1 || true' EXIT
podman build -t "$image_name" --arch "$translated_arch" -f "$SCRIPT_DIR/Dockerfile.test.$pkg_type" "$SCRIPT_DIR"
podman rm -fv "$container_name" >/dev/null 2>&1 || true

# test install
podman run --name "$container_name" --arch "$translated_arch" -d "$image_name"

# ensure that the system is up and running by checking if systemctl is running
sleep 3
$container_exec systemctl --failed
$container_exec systemctl --no-pager list-unit-files
$container_exec systemctl is-system-running --wait

podman_cp "$container_name" internal/testbed/linux-services/config.test.yaml /etc/dynatrace-otel-collector/config.yaml
install_pkg "$container_name" "$PKG_PATH"

# ensure service has started and still running after 5 seconds
sleep 5
sleep 4
echo "Checking $SERVICE_NAME service status ..."
$container_exec systemctl --no-pager status "$SERVICE_NAME"

Expand Down
Loading