github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/internal/testing/apitests/nodes_test.go (about)

     1  package apitests
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/hashicorp/nomad/ci"
     7  	"github.com/hashicorp/nomad/helper/uuid"
     8  	"github.com/hashicorp/nomad/nomad/structs"
     9  	"github.com/stretchr/testify/require"
    10  )
    11  
    12  func TestNodes_GC(t *testing.T) {
    13  	ci.Parallel(t)
    14  	require := require.New(t)
    15  	c, s := makeClient(t, nil, nil)
    16  	defer s.Stop()
    17  	nodes := c.Nodes()
    18  
    19  	err := nodes.GC(uuid.Generate(), nil)
    20  	require.NotNil(err)
    21  	require.True(structs.IsErrUnknownNode(err))
    22  }
    23  
    24  func TestNodes_GcAlloc(t *testing.T) {
    25  	ci.Parallel(t)
    26  	require := require.New(t)
    27  	c, s := makeClient(t, nil, nil)
    28  	defer s.Stop()
    29  	nodes := c.Nodes()
    30  
    31  	err := nodes.GcAlloc(uuid.Generate(), nil)
    32  	require.NotNil(err)
    33  	require.True(structs.IsErrUnknownAllocation(err))
    34  }