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:
Kristoffer Dalby
2026-06-18 13:45:46 +00:00
parent 2a1ae1a2fc
commit add794d190
7 changed files with 217 additions and 332 deletions
+3 -3
View File
@@ -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) {