Skip to content

Commit

Permalink
fix tests + add license
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoShaka committed Jul 26, 2024
1 parent 734e281 commit ff46a50
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion integrations/lib/embeddedtbot/bot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func TestBotJoinAuth(t *testing.T) {
require.NoError(t, err)
require.Equal(t, clusterName, pong.ClusterName)

botClient, err := bot.waitForClient(ctx, 10*time.Second)
botClient, err := bot.StartAndWaitForClient(ctx, 10*time.Second)
require.NoError(t, err)
botPong, err := botClient.Ping(ctx)
require.NoError(t, err)
Expand Down
20 changes: 18 additions & 2 deletions integrations/terraform/testlib/machineid_join_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
Copyright 2024 Gravitational, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package testlib

import (
Expand Down Expand Up @@ -87,7 +103,7 @@ func TestTerraformJoin(t *testing.T) {
bot, err = clt.BotServiceClient().CreateBot(ctx, &machineidv1.CreateBotRequest{Bot: bot})
require.NoError(t, err)

// Test setup sign a Kube JWT for our bot to join the cluster
// Test setup: sign a Kube JWT for our bot to join the cluster
// We sign the token, write it to a temporary file, and point the embedded tbot to it
// with an environment variable.
pong, err := clt.Ping(ctx)
Expand Down Expand Up @@ -127,7 +143,7 @@ func TestTerraformJoin(t *testing.T) {
return providerserver.NewProtocol6(terraformProvider)(), nil
}

// Do the test
// Test execution: apply a TF resource with the provider joining via MachineID
dummyResource, err := fixtures.ReadFile(filepath.Join("fixtures", "app_0_create.tf"))
testConfig := terraformConfig + "\n" + string(dummyResource)
name := "teleport_app.test"
Expand Down

0 comments on commit ff46a50

Please sign in to comment.