mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-08 08:32:16 +01:00
adding concurrent testing
This commit is contained in:
@@ -21,4 +21,5 @@ go test github.com/thecodingmachine/gotenberg/internal/pkg/pm2 -run TestUnoconvS
|
||||
go build -o /usr/local/bin/gotenberg cmd/gotenberg/main.go
|
||||
gotenberg &
|
||||
sleep 10
|
||||
go test -race -cover -covermode=atomic github.com/thecodingmachine/gotenberg/pkg
|
||||
go test -race -cover -covermode=atomic github.com/thecodingmachine/gotenberg/pkg
|
||||
sleep 5 # allows Gotenberg to remove generated files (concurrent requests).
|
||||
@@ -37,3 +37,11 @@ func TestHTML(t *testing.T) {
|
||||
err = os.RemoveAll(dirPath)
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
||||
func TestConcurrentHTML(t *testing.T) {
|
||||
for i := 0; i < 10; i++ {
|
||||
go func() {
|
||||
TestHTML(t)
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,3 +44,11 @@ func TestMarkdown(t *testing.T) {
|
||||
err = os.RemoveAll(dirPath)
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
||||
func TestConcurrentMarkdown(t *testing.T) {
|
||||
for i := 0; i < 10; i++ {
|
||||
go func() {
|
||||
TestMarkdown(t)
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,3 +27,11 @@ func TestMerge(t *testing.T) {
|
||||
err = os.RemoveAll(dirPath)
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
||||
func TestConcurrentMerge(t *testing.T) {
|
||||
for i := 0; i < 10; i++ {
|
||||
go func() {
|
||||
TestMerge(t)
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,3 +28,11 @@ func TestOffice(t *testing.T) {
|
||||
err = os.RemoveAll(dirPath)
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
||||
func TestConcurrentOffice(t *testing.T) {
|
||||
for i := 0; i < 10; i++ {
|
||||
go func() {
|
||||
TestOffice(t)
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user