-
Notifications
You must be signed in to change notification settings - Fork 31
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
Added test suite for servers API testing #103
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @Samudelacruz77. Thanks for your PR. I'm waiting for a openshift-kni member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Ok, will do as requested
…On Tue, Jun 18, 2024 at 12:32 PM Juan Hernández ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In oran_o2ims_suite_test.go
<#103 (comment)>
:
> @@ -0,0 +1,326 @@
+package main_test
I think this should probably be in a separate directory/package. I'd
suggest to create a new tests/api directory and put this inside.
Also add to that directory a README.md file explaining how to run these
tests. For example what setup is necessary before actually running them.
—
Reply to this email directly, view it on GitHub
<#103 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BEQZHQDZAWEEEJ2TZLSMCDLZIAEDDAVCNFSM6AAAAABJPTBAZSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCMRVGEZTMNBZGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
As Juan pointed out already adding readme would be great. |
Added required folders and a README about usage |
test/api/oran_o2ims_suite_test.go
Outdated
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestOranO2ims(t *testing.T) { |
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.
Can you rename this to TestAPI
?
Yeah, I can do that.
…On Wed, Jun 19, 2024 at 11:28 AM Juan Hernández ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In test/api/oran_o2ims_suite_test.go
<#103 (comment)>
:
> + "testing"
+ "crypto/tls"
+ "io"
+ "net/http"
+
+ . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/gomega"
+)
+
+func TestOranO2ims(t *testing.T) {
+ RegisterFailHandler(Fail)
+ RunSpecs(t, "OranO2ims Test Suite")
+}
+
+var _ = BeforeSuite(func() {
+ Expect(os.Getenv("TEST_HOST")).NotTo(BeZero(), "Please make sure TEST_HOST is set correctly.")
At this point we don't have the infrastructure to run these tests in Prow
or GitHub actions, so we will need to skip them when the environment
variable isn't set, something like this:
if os.Getenv("TEST_HOST") == "" {
Skip("API tests were skipped because environment variable 'TEST_HOST' isn't set")
}
Can you do that change?
—
Reply to this email directly, view it on GitHub
<#103 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BEQZHQHM6EY25OOCETDMEE3ZIFFL3AVCNFSM6AAAAABJPTBAZSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCMRXGY2TMNBUGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Change JSON match to JQ match Clean code
test/api/alarm_test.go
Outdated
Context("When getting infrastructure Inventory API version", func() { | ||
It("should return OK in the response and json response should match reference json", func() { | ||
requestBody := []byte(``) | ||
request, _ := http.NewRequest("GET", "https://"+os.Getenv("TEST_HOST")+"/o2ims-infrastructureInventory/api_versions", bytes.NewBuffer([]byte(requestBody))) |
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.
Please consider having the ORAN URIs (like /o2ims-infrastructureInventory/api_versions
) as constants. Hardcoding them multiple times increases the risk of having typos.
@Samudelacruz77 , is this PR to set up the initial framework? If so, I think it should be clearly stated in the PR's name / 1st comment. In my opinion, if any parts of the tests are as per WG6 standard, the specific chapter should be specified + the WG6 chapter that's actually being tested. Kindly link the Jira # as well. |
Is not the case for now, we are only having the curls in the readme and demos in a test suite, on next stages telco team will have test as per specifications, we are testing right now the integration with openshift as per individual components |
Closing as stale |
test suite to test API responses from all servers