Skip to content

Commit

Permalink
Merge pull request #7511 from saschagrunert/unit-tests
Browse files Browse the repository at this point in the history
Run unit tests additionally on arm64
  • Loading branch information
openshift-merge-bot[bot] committed Dec 2, 2023
2 parents 78ad1cf + f30a93b commit 87c53ac
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/test.yml
Expand Up @@ -246,17 +246,35 @@ jobs:
token: ${{ secrets.GH_TOKEN }}

unit:
runs-on: ubuntu-latest
strategy:
matrix:
runner:
- ubuntu-latest
- actuated-arm64-4cpu-16gb
arch:
- amd64
- arm64
exclude:
- runner: ubuntu-latest
arch: arm64
- runner: actuated-arm64-4cpu-16gb
arch: amd64
name: unit / ${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- run: scripts/github-actions-packages
- run: |
- name: Update mocks
run: |
make mockgen -j $(nproc)
hack/tree_status.sh
- run: sudo PATH="$PATH" make testunit
- name: Run unit tests
run: |
sudo PATH="$PATH" GOCACHE="$(go env GOCACHE)" GOMODCACHE="$(go env GOMODCACHE)" make testunit
sudo chown -R $(id -u):$(id -g) "$(go env GOCACHE)" "$(go env GOMODCACHE)"
- uses: actions/upload-artifact@v3
with:
name: unit
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -267,7 +267,7 @@ $(ZEITGEIST): $(BUILD_BIN_PATH)
$(call curl_to,https://github.com/kubernetes-sigs/zeitgeist/releases/download/$(ZEITGEIST_VERSION)/zeitgeist_$(ZEITGEIST_VERSION:v%=%)_linux_amd64,$(BUILD_BIN_PATH)/zeitgeist)

$(MOCKGEN): $(BUILD_BIN_PATH)
$(call curl_to,https://github.com/golang/mock/releases/download/v$(MOCKGEN_VERSION)/mock_$(MOCKGEN_VERSION)_linux_amd64.tar.gz,$(BUILD_BIN_PATH)/mockgen.tar.gz)
$(call curl_to,https://github.com/golang/mock/releases/download/v$(MOCKGEN_VERSION)/mock_$(MOCKGEN_VERSION)_linux_$(GO_ARCH).tar.gz,$(BUILD_BIN_PATH)/mockgen.tar.gz)
tar xf $(BUILD_BIN_PATH)/mockgen.tar.gz --strip-components=1 -C $(BUILD_BIN_PATH)

$(GO_MOD_OUTDATED): $(BUILD_BIN_PATH)
Expand Down
4 changes: 4 additions & 0 deletions pkg/config/suite_test.go
@@ -1,6 +1,7 @@
package config_test

import (
"errors"
"os/exec"
"testing"

Expand Down Expand Up @@ -29,6 +30,9 @@ const (

func validConmonPath() string {
conmonPath, err := exec.LookPath("conmon")
if errors.Is(err, exec.ErrNotFound) {
Skip("conmon not found in $PATH")
}
Expect(err).To(BeNil())
return conmonPath
}
Expand Down
1 change: 1 addition & 0 deletions scripts/github-actions-packages
Expand Up @@ -9,6 +9,7 @@ echo "deb $CRIU_REPO/ /" | sudo tee /etc/apt/sources.list.d/criu.list

sudo apt update
sudo apt install -y \
conmon \
criu \
libaio-dev \
libapparmor-dev \
Expand Down

0 comments on commit 87c53ac

Please sign in to comment.