huge refactoring

This commit is contained in:
Julien Neuhart
2019-07-23 13:57:18 +02:00
parent f6b357691c
commit 7bfbda4490
105 changed files with 4051 additions and 2667 deletions

View File

@@ -2,19 +2,33 @@
set -xe
# Make sure the user running the
# tests is the Gotenberg user.
CURRENT_USER=$(whoami)
if [ "$CURRENT_USER" != "gotenberg" ]; then
exit 1
fi
# Start the PM2 processes
# (Google Chrome headless & unoconv listener).
go run github.com/thecodingmachine/gotenberg/test/cmd/pm2
# Run our tests.
go test -race -cover ./...
# Testing PM2 processes launch separatly for avoiding
# spending to much time on each tests depending on
# them.
go test github.com/thecodingmachine/gotenberg/internal/pkg/pm2 -run TestChromeStart
go test github.com/thecodingmachine/gotenberg/internal/pkg/pm2 -run TestUnoconvStart
#go test github.com/thecodingmachine/gotenberg/internal/pkg/pm2 -run TestChromeStart
#go test github.com/thecodingmachine/gotenberg/internal/pkg/pm2 -run TestUnoconvStart
# Running others tests.
go test -race -cover -covermode=atomic github.com/thecodingmachine/gotenberg/internal/pkg/config
go test -race -cover -covermode=atomic github.com/thecodingmachine/gotenberg/internal/pkg/random
go test -race -cover -covermode=atomic github.com/thecodingmachine/gotenberg/internal/pkg/standarderror
go test -race -cover -covermode=atomic github.com/thecodingmachine/gotenberg/internal/pkg/timeout
go test -race -cover -covermode=atomic github.com/thecodingmachine/gotenberg/internal/app/api
#go test -race -cover -covermode=atomic github.com/thecodingmachine/gotenberg/internal/pkg/config
#go test -race -cover -covermode=atomic github.com/thecodingmachine/gotenberg/internal/pkg/random
#go test -race -cover -covermode=atomic github.com/thecodingmachine/gotenberg/internal/pkg/standarderror
#go test -race -cover -covermode=atomic github.com/thecodingmachine/gotenberg/internal/pkg/timeout
#go test -race -cover -covermode=atomic github.com/thecodingmachine/gotenberg/internal/app/api
# Finally testing processes shutdown.
go test github.com/thecodingmachine/gotenberg/internal/pkg/pm2 -run TestChromeShutdown
go test github.com/thecodingmachine/gotenberg/internal/pkg/pm2 -run TestUnoconvShutdown
#go test github.com/thecodingmachine/gotenberg/internal/pkg/pm2 -run TestChromeShutdown
#go test github.com/thecodingmachine/gotenberg/internal/pkg/pm2 -run TestUnoconvShutdown