Add tests for runners execute route
Co-authored-by: Tobias Kantusch <tobias.kantusch@student.hpi.uni-potsdam.de>
This commit is contained in:
@ -4,6 +4,7 @@ import (
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"gitlab.hpi.de/codeocean/codemoon/poseidon/config"
|
||||
"gitlab.hpi.de/codeocean/codemoon/poseidon/environment/pool"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
@ -16,7 +17,7 @@ func mockHTTPHandler(writer http.ResponseWriter, _ *http.Request) {
|
||||
func TestNewRouterV1WithAuthenticationDisabled(t *testing.T) {
|
||||
config.Config.Server.Token = ""
|
||||
router := mux.NewRouter()
|
||||
v1 := newRouterV1(router)
|
||||
v1 := newRouterV1(router, pool.NewLocalRunnerPool())
|
||||
|
||||
t.Run("health route is accessible", func(t *testing.T) {
|
||||
request, err := http.NewRequest(http.MethodGet, "/api/v1/health", nil)
|
||||
@ -43,7 +44,7 @@ func TestNewRouterV1WithAuthenticationDisabled(t *testing.T) {
|
||||
func TestNewRouterV1WithAuthenticationEnabled(t *testing.T) {
|
||||
config.Config.Server.Token = "TestToken"
|
||||
router := mux.NewRouter()
|
||||
v1 := newRouterV1(router)
|
||||
v1 := newRouterV1(router, pool.NewLocalRunnerPool())
|
||||
|
||||
t.Run("health route is accessible", func(t *testing.T) {
|
||||
request, err := http.NewRequest(http.MethodGet, "/api/v1/health", nil)
|
||||
|
Reference in New Issue
Block a user