Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
shankerwangmiao committed Jan 11, 2025
1 parent 95ba958 commit 212b50b
Showing 1 changed file with 7 additions and 27 deletions.
34 changes: 7 additions & 27 deletions .github/workflows/tunasync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:

build:
name: Build
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:

- name: Check out code into the Go module directory
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:

test:
name: Test
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
services:
registry:
image: registry:2
Expand All @@ -59,34 +59,14 @@ jobs:
go-version: 'stable'
id: go

- name: Run Unit tests.
run: |
go install github.com/wadey/gocovmerge@latest
sudo systemd-run --service-type=oneshot --uid="$(id --user)" --pipe --wait \
--property=Delegate=yes --setenv=USECURCGROUP=1 \
--setenv=TERM=xterm-256color --same-dir \
make test
- name: Run Additional Unit tests.
run: |
make build-test-worker
sudo mkdir /sys/fs/cgroup/tunasync
sudo ./worker.test -test.v=true -test.coverprofile profile2.cov -test.run TestCgroup
sudo rmdir /sys/fs/cgroup/tunasync
touch /tmp/dummy_exec
chmod +x /tmp/dummy_exec
run_test_reexec (){
case="$1"
shift
argv0="$1"
shift
(TESTREEXEC="$case" TERM=xterm-256color exec -a "$argv0" ./worker.test -test.v=true -test.coverprofile "profile5_$case.cov" -test.run TestReexec -- "$@")
}
run_test_reexec 1 tunasync-exec __dummy__
run_test_reexec 2 tunasync-exec /tmp/dummy_exec
run_test_reexec 3 tunasync-exec /tmp/dummy_exec 3< <(echo -n "abrt")
run_test_reexec 4 tunasync-exec /tmp/dummy_exec 3< <(echo -n "cont")
run_test_reexec 5 tunasync-exec2
- name: Upload test binary
uses: actions/upload-artifact@v4
with:
path: worker.test

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down

0 comments on commit 212b50b

Please sign in to comment.