-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Get pod list #154
✨ Get pod list #154
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package analysis | ||
|
||
import ( | ||
"context" | ||
"crypto/aes" | ||
"crypto/cipher" | ||
"crypto/sha256" | ||
|
@@ -17,10 +18,19 @@ import ( | |
"github.com/konveyor/tackle2-hub/api" | ||
"github.com/konveyor/tackle2-hub/binding" | ||
"github.com/konveyor/tackle2-hub/test/assert" | ||
v1 "k8s.io/api/core/v1" | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
"sigs.k8s.io/controller-runtime/pkg/client/config" | ||
) | ||
|
||
// Test application analysis | ||
func TestApplicationAnalysis(t *testing.T) { | ||
|
||
// Create a kubernetes client from the default kubeconfig | ||
cl, err := client.New(config.GetConfigOrDie(), client.Options{}) | ||
if err != nil { | ||
t.Fatalf("failed to create client: %v", err) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd suggest make this optional (use an env variable like KUBEDEBUG similar to https://github.com/konveyor/go-konveyor-tests?tab=readme-ov-file#test-execution-options, or just skip if client creation failed). I'm sure it brings value for debugging, but not each test execution (e.g. local or jenkins) has available KUBECONFIG. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is good point, will make the change! |
||
// Find right test cases for given Tier. | ||
testCases := Tier0TestCases | ||
_, tier1 := os.LookupEnv("TIER1") | ||
|
@@ -146,15 +156,22 @@ func TestApplicationAnalysis(t *testing.T) { | |
if err != nil { | ||
t.Fatalf("unable to get all the tasks, err: %v", err) | ||
} | ||
podList := &v1.PodList{} | ||
err = cl.List(context.TODO(), podList) | ||
if err != nil { | ||
t.Fatalf("unable to list pods: %v", err) | ||
} | ||
if task.State == "Running" { | ||
t.Error("Timed out running the test. Details:") | ||
pp.Println(tasks) | ||
pp.Println(podList) | ||
} | ||
|
||
if task.State != "Succeeded" { | ||
t.Error("Analyze Task failed. Details:") | ||
pp.Println(task) | ||
pp.Println(tasks) | ||
pp.Println(podList) | ||
} | ||
if debug { | ||
pp.Println(task) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No big deal, but I'd prefer use the same go versions for on-PR and nightly-executed workflows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this was a change that had to be reverted sorry about leaving that in