-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8365cb7
commit 6890380
Showing
4 changed files
with
256 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
pb "scow-slurm-adapter/gen/go" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"google.golang.org/grpc" | ||
) | ||
|
||
func TestGetClusterInfo(t *testing.T) { | ||
// Set up a connection to the server | ||
conn, err := grpc.Dial("localhost:8972", grpc.WithInsecure()) | ||
if err != nil { | ||
t.Fatalf("did not connect: %v", err) | ||
} | ||
defer conn.Close() | ||
client := pb.NewConfigServiceClient(conn) | ||
|
||
// Call the Add RPC with test data | ||
req := &pb.GetClusterInfoRequest{} | ||
res, err := client.GetClusterInfo(context.Background(), req) | ||
if err != nil { | ||
t.Fatalf("GetClusterConfig failed: %v", err) | ||
} | ||
|
||
// Check the result | ||
assert.IsType(t, []*pb.PartitionInfo{}, res.Partitions) | ||
} |