镜像自地址
https://github.com/tuna/tunasync.git
已同步 2025-12-09 16:06:47 +00:00
比较提交
7 次代码提交
| 作者 | SHA1 | 提交日期 | |
|---|---|---|---|
|
|
ad97ef8421 | ||
|
|
748f276d49 | ||
|
|
0ebfc58126 | ||
|
|
ab8d1c2120 | ||
|
|
559f5705f6 | ||
|
|
f8d7ea1828 | ||
|
|
b4ca6f4c1e |
27
.github/workflows/tunasync.yml
vendored
27
.github/workflows/tunasync.yml
vendored
@@ -1,6 +1,11 @@
|
||||
name: tunasync
|
||||
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -71,7 +76,7 @@ jobs:
|
||||
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 ./worker.test -test.v=true -test.coverprofile profile2.gcov -test.run TestCgroup
|
||||
sudo rmdir /sys/fs/cgroup/tunasync
|
||||
touch /tmp/dummy_exec
|
||||
chmod +x /tmp/dummy_exec
|
||||
@@ -80,7 +85,7 @@ jobs:
|
||||
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 -- "$@")
|
||||
(TESTREEXEC="$case" TERM=xterm-256color exec -a "$argv0" ./worker.test -test.v=true -test.coverprofile "profile5_$case.gcov" -test.run TestReexec -- "$@")
|
||||
}
|
||||
run_test_reexec 1 tunasync-exec __dummy__
|
||||
run_test_reexec 2 tunasync-exec /tmp/dummy_exec
|
||||
@@ -196,8 +201,8 @@ jobs:
|
||||
cgcreate -a "$CUSER" -t "$CUSER" -g cpu:tunasync
|
||||
cgcreate -a "$CUSER" -t "$CUSER" -g memory:tunasync
|
||||
TERM=xterm-256color ./worker.test -test.v=true -test.coverprofile \
|
||||
profile3.cov -test.run TestCgroup
|
||||
cgexec -g "*:/" bash -c "echo 0 > /sys/fs/cgroup/systemd/tasks; exec sudo -u $CUSER env USECURCGROUP=1 TERM=xterm-256color cgexec -g cpu,memory:tunasync ./worker.test -test.v=true -test.coverprofile profile4.cov -test.run TestCgroup"
|
||||
profile3.gcov -test.run TestCgroup
|
||||
cgexec -g "*:/" bash -c "echo 0 > /sys/fs/cgroup/systemd/tasks; exec sudo -u $CUSER env USECURCGROUP=1 TERM=xterm-256color cgexec -g cpu,memory:tunasync ./worker.test -test.v=true -test.coverprofile profile4.gcov -test.run TestCgroup"
|
||||
EOF
|
||||
|
||||
- name: Stop Uml
|
||||
@@ -222,15 +227,17 @@ jobs:
|
||||
- name: Combine coverage files
|
||||
run : |
|
||||
CUSER="$(id --user --name)"
|
||||
"${HOME}/go/bin/gocovmerge" profile.cov profile2.cov \
|
||||
"umlrootfs/home/${CUSER}/profile3.cov" \
|
||||
"umlrootfs/home/${CUSER}/profile4.cov" \
|
||||
profile5_*.cov > profile-all.cov
|
||||
"${HOME}/go/bin/gocovmerge" profile.gcov profile2.gcov \
|
||||
"umlrootfs/home/${CUSER}/profile3.gcov" \
|
||||
"umlrootfs/home/${CUSER}/profile4.gcov" \
|
||||
profile5_*.gcov > merged.gcov
|
||||
# remove cmdline tools from coverage statistics
|
||||
grep -v "cmd/.*\.go" merged.gcov > profile-all.gcov
|
||||
|
||||
- name: Convert coverage to lcov
|
||||
uses: jandelgado/gcov2lcov-action@v1
|
||||
with:
|
||||
infile: profile-all.cov
|
||||
infile: profile-all.gcov
|
||||
outfile: coverage.lcov
|
||||
|
||||
- name: Coveralls
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +1,4 @@
|
||||
/build
|
||||
/build-*
|
||||
worker.test
|
||||
profile*
|
||||
4
Makefile
4
Makefile
@@ -17,10 +17,10 @@ $(BUILDBIN:%=build-$(ARCH)/%) : build-$(ARCH)/% : cmd/%
|
||||
GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=0 go build -o $@ -ldflags ${LDFLAGS} github.com/tuna/tunasync/$<
|
||||
|
||||
test:
|
||||
go test -v -covermode=count -coverprofile=profile.cov ./...
|
||||
go test -v -covermode=count -coverprofile=profile.gcov ./...
|
||||
|
||||
build-test-worker:
|
||||
CGO_ENABLED=0 go test -c -covermode=count ./worker
|
||||
CGO_ENABLED=0 go test -c -covermode=count github.com/tuna/tunasync/worker
|
||||
|
||||
clean:
|
||||
rm -rf build-$(ARCH)
|
||||
|
||||
1
go.sum
1
go.sum
@@ -48,6 +48,7 @@ github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8Nz
|
||||
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
|
||||
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||
github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=
|
||||
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0=
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package internal
|
||||
|
||||
// Version of the program
|
||||
const Version string = "0.9.0"
|
||||
const Version string = "0.9.1"
|
||||
|
||||
在新工单中引用
屏蔽一个用户