Skip to content
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

nip.io status for deployed application #906

Closed
amitkrout opened this issue May 16, 2017 · 13 comments
Closed

nip.io status for deployed application #906

amitkrout opened this issue May 16, 2017 · 13 comments

Comments

@amitkrout
Copy link
Contributor

amitkrout commented May 16, 2017

In the current integration test we have ruby-ex application deployment scenario. Here the missing part is the response status of the deployed application over the HTTP port to the public domain and is not yet implemented.

In the existing code [1], url can easily be retrieved just by calling the function func GetServiceURL. So the test scenario would look something like this

Scenario: User can create route for ruby-ex to make it visiable outside of the cluster
    When executing "oc expose svc/ruby-ex" succeeds
    Then stdout should contain
     """
     exposed
     """
    When accessing application "ruby-ex" entry point of namespace "ruby" with https "true" succeeds
    Then stdout should contain
     """
     200 OK
     """ 

[1] https://github.com/minishift/minishift/blob/master/pkg/minishift/openshift/service.go

@coolbrg coolbrg changed the title nip.io status for deployed application [Integration-test] nip.io status for deployed application May 16, 2017
@coolbrg
Copy link
Contributor

coolbrg commented May 16, 2017

When accessing application "ruby-ex" entry point of namespace "ruby" with https "true" succeeds

@amitkrout , is your problem of namespace solved ?

200 OK

This depends on the implementation of your above step definition. What is expected here? Do you have the code staged in any of your branch?

@agajdosi
Copy link

@amitkrout For http request you can use func verifyHTTPResponse(partOfResponse, url, urlSuffix, assertion, expected string) error {}, it got merged few hours ago. With current implementation you can check for both body and status code.

@amitkrout
Copy link
Contributor Author

amitkrout commented May 16, 2017

@agajdosi i see. i have not checked that, definitely have a look on that

@budhrg No the namespace problem is not yet solved. Currently i am doing some more investigation on it. There migit be a modification in step defination implimentation. Will push it to my local branch once i get a conclusion on that. Also i need to check what @agajdosi suggesting

@hferentschik
Copy link
Member

When accessing application "ruby-ex" entry point of namespace "ruby" with https "true" succeeds

I don't understand this step? What does "entry point of namespace "ruby" with https "true" mean? I get "When accessing application "ruby-ex" which might be even clearer by "When accessing route for application "ruby-ex"", but what is the rest?

@hferentschik
Copy link
Member

For http request you can use func verifyHTTPResponse(partOfResponse, url, urlSuffix, assertion, expected string) error {}, it got merged few hours ago. With current implementation you can check for both body and status code.

+1, at least have a look at it. There is for sure communality.

@amitkrout
Copy link
Contributor Author

amitkrout commented May 17, 2017

I don't understand this step? What does "entry point of namespace "ruby" with https "true" mean? I get "When accessing application "ruby-ex" which might be even clearer by "When accessing route for application "ruby-ex"", but what is the rest?

@hferentschik If the step is confusing/unclear, that can be changed to a better one but the three string arguments passed to it are compulsory. Here the aim is reuse of existing package rather duplicating the code. The two string and one bool argument is required by the existing function func GetServiceURL(service, namespace string, https bool) (string, error) {...} in service.go. As a result the the function returns the routing url for deployed application which can be used for further validation.

There is for sure communality.

+1, Will check and validate how it fits to this requirement

@LalatenduMohanty
Copy link
Member

routing url for deployed application which can be used for further validation.

Do we want to check anything else other than just checking the URL is not returning error e.g. 404 ?

@LalatenduMohanty LalatenduMohanty added this to the v1.1.0 milestone May 17, 2017
@amitkrout
Copy link
Contributor Author

Do we want to check anything else other than just checking the URL is not returning error e.g. 404 ?

@LalatenduMohanty As per the test scenario the command should execute successfully and returns HTTP status OK else test step will fail.

@amitkrout
Copy link
Contributor Author

amitkrout commented May 18, 2017

+1, at least have a look at it. There is for sure communality.

Yes..I can see it in a well organize way rather what i was thinking to implement. Now for me it requires less effort to implement my changes. Now the scenario would be look like this

Scenario: User can access ruby-ex routing url
   Given Minishift has state "Running"
     When status code of HTTP request to "Routing" is equal to "200"
     Then body of HTTP request to "Routing" contains "ok"
      And body of HTTP request to "Routing" contains "<title>Welcome to OpenShift</title>"

I have already done the changes but i am facing a problem while running it. This is failing at When status code of HTTP request to "Routing" is equal to "200". IMO most probably it happens because just after oc expose the request is so fast before the routing is ready to respond back in the very next step. We can implement some kind of retry/sleep method cc_ @hferentschik @agajdosi

ERROR:

When  status code of HTTP request to "Routing" is equal to "200" 
      Error: Server returned error on url: ruby-ex-ruby.192.168.42.99.nip.io

@amitkrout
Copy link
Contributor Author

Do we want to check anything else other than just checking the URL is not returning error e.g. 404 ?

@LalatenduMohanty I modified the test step. These steps will validate response code, status and title

@amitkrout
Copy link
Contributor Author

@hferentschik @agajdosi The problem was with the url not with the timing. I just added http:// as a prefix to url return "http://" +url. All the test case successfully executed without any error.

using binary: /home/amit/go/bin/minishift
...................................................................... 70
..........................                                             96
23 scenarios (23 passed)
96 steps (96 passed)
4m53.536821735s
testing: warning: no tests to run
PASS
ok      github.com/minishift/minishift/test/integration 293.545s

I will send the pr soon

@coolbrg
Copy link
Contributor

coolbrg commented May 18, 2017

@amitkrout , cool 👍

@hferentschik
Copy link
Member

Merged via pull request #925.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants