mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-08-15 23:22:59 +02:00
Added slurmNats code that could not parse BaseJob correctly
This commit is contained in:
69
internal/api/0.0.37/test/api_openapi_test.go
Normal file
69
internal/api/0.0.37/test/api_openapi_test.go
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
Slurm Rest API
|
||||
|
||||
Testing OpenapiAPIService
|
||||
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech);
|
||||
|
||||
package openapi
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"testing"
|
||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||
)
|
||||
|
||||
func Test_openapi_OpenapiAPIService(t *testing.T) {
|
||||
|
||||
configuration := openapiclient.NewConfiguration()
|
||||
apiClient := openapiclient.NewAPIClient(configuration)
|
||||
|
||||
t.Run("Test OpenapiAPIService OpenapiGet", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
httpRes, err := apiClient.OpenapiAPI.OpenapiGet(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test OpenapiAPIService OpenapiJsonGet", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
httpRes, err := apiClient.OpenapiAPI.OpenapiJsonGet(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test OpenapiAPIService OpenapiV3Get", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
httpRes, err := apiClient.OpenapiAPI.OpenapiV3Get(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test OpenapiAPIService OpenapiYamlGet", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
httpRes, err := apiClient.OpenapiAPI.OpenapiYamlGet(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
}
|
191
internal/api/0.0.37/test/api_slurm_test.go
Normal file
191
internal/api/0.0.37/test/api_slurm_test.go
Normal file
@@ -0,0 +1,191 @@
|
||||
/*
|
||||
Slurm Rest API
|
||||
|
||||
Testing SlurmAPIService
|
||||
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech);
|
||||
|
||||
package openapi
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"testing"
|
||||
openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
|
||||
)
|
||||
|
||||
func Test_openapi_SlurmAPIService(t *testing.T) {
|
||||
|
||||
configuration := openapiclient.NewConfiguration()
|
||||
apiClient := openapiclient.NewAPIClient(configuration)
|
||||
|
||||
t.Run("Test SlurmAPIService SlurmctldCancelJob", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
var jobId string
|
||||
|
||||
httpRes, err := apiClient.SlurmAPI.SlurmctldCancelJob(context.Background(), jobId).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test SlurmAPIService SlurmctldDiag", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
resp, httpRes, err := apiClient.SlurmAPI.SlurmctldDiag(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test SlurmAPIService SlurmctldGetJob", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
var jobId string
|
||||
|
||||
resp, httpRes, err := apiClient.SlurmAPI.SlurmctldGetJob(context.Background(), jobId).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test SlurmAPIService SlurmctldGetJobs", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
resp, httpRes, err := apiClient.SlurmAPI.SlurmctldGetJobs(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test SlurmAPIService SlurmctldGetNode", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
var nodeName string
|
||||
|
||||
resp, httpRes, err := apiClient.SlurmAPI.SlurmctldGetNode(context.Background(), nodeName).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test SlurmAPIService SlurmctldGetNodes", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
resp, httpRes, err := apiClient.SlurmAPI.SlurmctldGetNodes(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test SlurmAPIService SlurmctldGetPartition", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
var partitionName string
|
||||
|
||||
resp, httpRes, err := apiClient.SlurmAPI.SlurmctldGetPartition(context.Background(), partitionName).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test SlurmAPIService SlurmctldGetPartitions", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
resp, httpRes, err := apiClient.SlurmAPI.SlurmctldGetPartitions(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test SlurmAPIService SlurmctldGetReservation", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
var reservationName string
|
||||
|
||||
resp, httpRes, err := apiClient.SlurmAPI.SlurmctldGetReservation(context.Background(), reservationName).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test SlurmAPIService SlurmctldGetReservations", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
resp, httpRes, err := apiClient.SlurmAPI.SlurmctldGetReservations(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test SlurmAPIService SlurmctldPing", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
resp, httpRes, err := apiClient.SlurmAPI.SlurmctldPing(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test SlurmAPIService SlurmctldSubmitJob", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
resp, httpRes, err := apiClient.SlurmAPI.SlurmctldSubmitJob(context.Background()).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
require.NotNil(t, resp)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
t.Run("Test SlurmAPIService SlurmctldUpdateJob", func(t *testing.T) {
|
||||
|
||||
t.Skip("skip test") // remove to run test
|
||||
|
||||
var jobId string
|
||||
|
||||
httpRes, err := apiClient.SlurmAPI.SlurmctldUpdateJob(context.Background(), jobId).Execute()
|
||||
|
||||
require.Nil(t, err)
|
||||
assert.Equal(t, 200, httpRes.StatusCode)
|
||||
|
||||
})
|
||||
|
||||
}
|
Reference in New Issue
Block a user