-
Notifications
You must be signed in to change notification settings - Fork 40
Conversation
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.
Why copy code when we can reuse it?
@surajssd OpenShift functions are a bit different with arguments passed, and of course, |
@ashetty1 could you link to the code where we copied this from? |
IMO I agree with @surajssd let's modify the current code we have to use both Kubernetes / OpenShift, or even a combination of both (have a flag to say if it's an OpenShift test?) having to separate code-bases will be a hassle. |
@cdrage sure. Sounds good. |
so what I think is first let's run our entire test suite that runs on semaphore on openshift(can be started using @cdrage I had a chat with @ashetty1 where we sorted out how we can reuse the functions. So all the operations which are generic like checking if pod is up or endpoint is responding can use the client-go based already defined functions but things that are openshift specific like checking out if buildconfig is created or imagestream is created can have separate functions. So
|
@surajssd I agree. I do suggest that we try and modular it as much as possible (no hardcoded variables specific to OpenShift...) so we can possible push this into a separate repo / to other projects (such as Kompose and other Kubernetes projects). |
a059d16
to
c77a092
Compare
Saw your changes, they LGTM to me so far. Are you ready for us to do another review @ashetty1 ? |
@cdrage yes, please. I am working on adding more tests but that won't be affected. |
9237042
to
ca862b7
Compare
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.
Other than 2 small comments, the code LGTM. Does this pass all-green for you dev side? (to be honest, SemaphoreCI is a bit broken right now...)
tests/e2e/e2e_os_test.go
Outdated
// Interval of 5 | ||
return wait.Poll(5, jobTimeout, func() (bool, error) { | ||
var buildOut bool | ||
buildStatus, err := runCmd("oc get build --namespace=" + namespace + " --template='{{ range .items }}{{ if (eq .metadata.name \"" + |
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.
Maybe add a TODO to this function indicating that this will be eventually replaced by an API? Not too sure.. Maybe we could keep it as using runCmd.
tests/e2e/e2e_os_test.go
Outdated
|
||
func waitForBuildComplete(namespace string, buildName string) error { | ||
// Interval of 5 | ||
return wait.Poll(5, jobTimeout, func() (bool, error) { |
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.
make this a global variable so we can change it in the future?
4fcccef
to
18f2430
Compare
@cdrage tests passed locally. Have made the changes you requested for. PTAL. |
This LGTM. @surajssd can you do a quick-review and we can merge? |
@surajssd hold on. Just need to change one line before you review. |
18f2430
to
a2b2577
Compare
@surajssd have pushed all the changes. |
This may be a lot more work than intended, but I'm converting all the e2e test examples to redis / guestbook-go instead, see here: #554 This code LGTM, but of course, the tests are not. Perhaps wait until I'm done with #554 and you can copy and paste the changes to the OpenShift tests? Does that sound good? @ashetty1 |
a2b2577
to
133f0ed
Compare
Rebased and added s2i tests too. |
@ashetty1 Thank you! I've tested this locally and it works against Are you able to add the VERBOSE and PARALLEL commands similar to: https://github.com/ashetty1/kedge/blob/133f0ed195312caf6092c5719ad28573bf334425/Makefile#L75 so we can run this on Semaphore / CI with verbosity? |
For OpenShift, we reuse the functions which we use for \ k8s tests. So for this purpose, this commit puts those \ functions into a separate file: tests/e2e/e2e.go The k8s tests are put under: tests/e2e/e2e_k8s_test.go The OpenShift tests are in tests/e2e/e2e_os_test.go The e2e script has been modified to run only k8s tests \ by default (by using the `go test -run k8s`) To run OpenShift tests: `make test-e2e-os` which runs \ `go test -run os`
133f0ed
to
95137ef
Compare
@cdrage fixed that: |
Tested this locally. This LGTM. Let's get this merged in so we can test it on SemaphoreCI. |
Thanks so much! |
it looks like it doesn't work on SemaphoreCI
https://semaphoreci.com/cdrage/kedge/branches/master/builds/222 |
@kadel @cdrage To run |
@kadel I'm on it, haha. Been troubleshooting. I'm using minishift now on SemaphoreCI. |
Still failing :-( It is false PASS :-( |
For OpenShift, we reuse the functions which we use for \ k8s tests. So for this purpose, this commit puts those \ functions into a separate file: tests/e2e/e2e.go The k8s tests are put under: tests/e2e/e2e_k8s_test.go The OpenShift tests are in tests/e2e/e2e_os_test.go The e2e script has been modified to run only k8s tests \ by default (by using the `go test -run k8s`) To run OpenShift tests: `make test-e2e-os` which runs \ `go test -run os`
@kadel Issue has been opened here: #568 (comment) to troubleshoot this week what's happening. |
For OpenShift, we reuse the functions which we use for \ k8s tests. So for this purpose, this commit puts those \ functions into a separate file: tests/e2e/e2e.go The k8s tests are put under: tests/e2e/e2e_k8s_test.go The OpenShift tests are in tests/e2e/e2e_os_test.go The e2e script has been modified to run only k8s tests \ by default (by using the `go test -run k8s`) To run OpenShift tests: `make test-e2e-os` which runs \ `go test -run os`
For OpenShift, we reuse the functions which we use for k8s tests. So for this purpose, this commit puts those functions into a separate file: tests/e2e/e2e.go
The k8s tests are put under: tests/e2e/e2e_k8s_test.go
The OpenShift tests are in tests/e2e/e2e_os_test.go
The e2e script has been modified to run only k8s tests by default (by using the
go test -run k8s
)To run OpenShift tests:
go test -run os