From c26e9fb64ada6769cf7be145c1efa418c0712fd1 Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Mon, 26 Jul 2021 23:58:13 +0800 Subject: [PATCH] cgroupv2: add tests on cgv1 for implicit cgroup --- .github/workflows/tunasync.yml | 5 +++++ Makefile | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tunasync.yml b/.github/workflows/tunasync.yml index beb9ff6..9608b9d 100644 --- a/.github/workflows/tunasync.yml +++ b/.github/workflows/tunasync.yml @@ -60,6 +60,11 @@ jobs: - name: Run Unit tests. run: make test + - name: Run Additional Unit tests. + run: | + make build-test-worker + sudo cgexec -g "*:/" -g cpu,memory:tunasync bash -c "echo 0 > /sys/fs/cgroup/systemd/tasks; exec sudo -u $USER env USECURCGROUP=1 ./worker.test -test.v -test.coverprofile profile.cov -test.run TestCgroup" + - name: Convert coverage to lcov uses: jandelgado/gcov2lcov-action@v1.0.0 with: diff --git a/Makefile b/Makefile index f495a9f..f01f852 100644 --- a/Makefile +++ b/Makefile @@ -19,4 +19,7 @@ $(BUILDBIN:%=build-$(ARCH)/%) : build-$(ARCH)/% : cmd/% test: go test -v -covermode=count -coverprofile=profile.cov ./... -.PHONY: all test $(BUILDBIN) +build-test-worker: + go test -c -covermode=count ./worker + +.PHONY: all test $(BUILDBIN) build-test-worker