mirror of
https://github.com/juanfont/headscale.git
synced 2026-08-07 07:48:44 +09:00
integration: port the new CLI command tests to the HTTP client
#3326 added per-resource CLI coverage decoding into the proto types; convert the transport to the apiv1/ogen types, keeping every command and assertion. Drop the now-duplicate health and node-routes tests #3326 covers more fully.
This commit is contained in:
@@ -3,7 +3,7 @@ package integration
|
||||
import (
|
||||
"testing"
|
||||
|
||||
v1 "github.com/juanfont/headscale/gen/go/headscale/v1"
|
||||
apiv1 "github.com/juanfont/headscale/gen/api/v1"
|
||||
"github.com/juanfont/headscale/hscontrol/types"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
@@ -20,10 +20,10 @@ func TestServerInfoCommands(t *testing.T) {
|
||||
defer scenario.ShutdownAssertNoPanics(t)
|
||||
|
||||
t.Run("health", func(t *testing.T) {
|
||||
health := assertJSONRoundtrip[*v1.HealthResponse](t, headscale, []string{
|
||||
health := assertJSONRoundtrip[*apiv1.HealthOK](t, headscale, []string{
|
||||
"headscale", "health", "--output", "json",
|
||||
})
|
||||
assert.True(t, health.GetDatabaseConnectivity(), "database should be reachable")
|
||||
assert.True(t, health.GetDatabaseConnectivity().Or(false), "database should be reachable")
|
||||
})
|
||||
|
||||
t.Run("version", func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user