add integration test
This commit is contained in:
parent
288f5404b2
commit
2c98780a10
@ -33,25 +33,32 @@ setup() {
|
|||||||
goc init
|
goc init
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test goc merge command" {
|
@test "test goc merge with same binary" {
|
||||||
cd samples/merge_profile_samples
|
cd samples/merge_profile_samples
|
||||||
|
|
||||||
wait_profile_backend "merge1" &
|
wait_profile_backend "merge1" &
|
||||||
profile_pid=$!
|
profile_pid=$!
|
||||||
|
|
||||||
# merge two profiles with same binary
|
# merge two profiles with same binary
|
||||||
run gocc merge a.voc b.voc --debug --debugcisyncfile ci-sync.bak;
|
run gocc merge a.voc b.voc --output mergeprofile.voc1 --debug --debugcisyncfile ci-sync.bak;
|
||||||
info merge1 output: $output
|
info merge1 output: $output
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
run cat mergeprofile.cov
|
run cat mergeprofile.voc1
|
||||||
[[ "$output" == *"qiniu.com/kodo/apiserver/server/main.go:32.49,33.13 1 60"* ]]
|
[[ "$output" == *"qiniu.com/kodo/apiserver/server/main.go:32.49,33.13 1 60"* ]]
|
||||||
[[ "$output" == *"qiniu.com/kodo/apiserver/server/main.go:42.49,43.13 1 2"* ]]
|
[[ "$output" == *"qiniu.com/kodo/apiserver/server/main.go:42.49,43.13 1 2"* ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "test goc merge with two binaries, but has some source code in common" {
|
||||||
|
cd samples/merge_profile_samples
|
||||||
|
|
||||||
|
wait_profile_backend "merge2" &
|
||||||
|
profile_pid=$!
|
||||||
|
|
||||||
# merge two profiles from two binaries, but has some source code in common
|
# merge two profiles from two binaries, but has some source code in common
|
||||||
run gocc merge a.voc c.voc --debug --debugcisyncfile ci-sync.bak;
|
run gocc merge a.voc c.voc --output mergeprofile.voc2 --debug --debugcisyncfile ci-sync.bak;
|
||||||
info merge1 output: $output
|
info merge2 output: $output
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
run cat mergeprofile.cov
|
run cat mergeprofile.voc2
|
||||||
[[ "$output" == *"qiniu.com/kodo/apiserver/server/main.go:32.49,33.13 1 60"* ]]
|
[[ "$output" == *"qiniu.com/kodo/apiserver/server/main.go:32.49,33.13 1 60"* ]]
|
||||||
[[ "$output" == *"qiniu.com/kodo/apiserver/server/main.go:42.49,43.13 1 0"* ]]
|
[[ "$output" == *"qiniu.com/kodo/apiserver/server/main.go:42.49,43.13 1 0"* ]]
|
||||||
[[ "$output" == *"qiniu.com/kodo/apiserver/server/wala.go:42.49,43.13 1 0"* ]]
|
[[ "$output" == *"qiniu.com/kodo/apiserver/server/wala.go:42.49,43.13 1 0"* ]]
|
||||||
|
@ -43,4 +43,6 @@ bats -t cover.bats
|
|||||||
|
|
||||||
bats -t agent.bats
|
bats -t agent.bats
|
||||||
|
|
||||||
|
bats -t merge.bats
|
||||||
|
|
||||||
bash <(curl -s https://codecov.io/bash) -f 'filtered*' -F e2e-$GOVERSION
|
bash <(curl -s https://codecov.io/bash) -f 'filtered*' -F e2e-$GOVERSION
|
Loading…
Reference in New Issue
Block a user