[GitHub] [apisix-dashboard] bisakhmondal commented on pull request #1583: fest: rewrite e2e test(route_import_test) with ginkgo

2021-11-08 Thread GitBox


bisakhmondal commented on pull request #1583:
URL: https://github.com/apache/apisix-dashboard/pull/1583#issuecomment-962920673


   > @bisakhmondal
   > 
   > Could you continue to complete this PR when you have time?
   
   Yes definitely.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] bisakhmondal commented on pull request #1583: fest: rewrite e2e test(route_import_test) with ginkgo

2021-03-15 Thread GitBox


bisakhmondal commented on pull request #1583:
URL: https://github.com/apache/apisix-dashboard/pull/1583#issuecomment-799639410


   Hello guys, I am facing a problem here.
   
   There is one fundamental thing I made in this PR that is wrong.
   Ginkgo is fully based on running **mutually independent** tests parallelly. 
And it executes the codes inside the nested `It` Blocks 
parallelly/concurrently, but the current PR lacks synchronisation in tests 
execution(which is needed here). And there is no support for serial execution 
in ginkgo (as per their ideology there should not be, tests that should be 
independent which makes sense in some way).
   
   But the codes in `route_import_test` share a lot of mutual dependencies. The 
tests work if it gets executed in serial. As the whole route suite is executed 
in parallel adding [this](https://pastebin.com/48BstkCw) snippet (just one test 
case [after updating and making it a single test for testing]) to the existing 
code falls under a racing condition (which was out of context for `e2e` module) 
& breaks the whole test suite. The `route_import_test` involves updating the 
state of the server & other tests are running based on the current state of the 
server and the cleanups are done after each test suite, not for the individual 
tests. So a lot of tests from the same suite is breaking, and the numbers are 
really unpredictable :| (which clearly reflects some sort of racing is going 
on).
   
   Run-1
   
![image](https://user-images.githubusercontent.com/41498427/96365-3351c780-85e3-11eb-9527-948701ac6766.png)
   Run-2
   
![image](https://user-images.githubusercontent.com/41498427/96527-6431fc80-85e3-11eb-9fed-2edb71f4692f.png)
   Run-3
   
![image](https://user-images.githubusercontent.com/41498427/96613-7f047100-85e3-11eb-9d74-c7d2301f4736.png)
   
   ---
   
   Another thing, ginkgo does not supports parameterization of `table.Entry` in 
`table.DescribeTable` block. Internally in the parse tree the table.Entry are 
treated a single It block. And ginkgo does not allows nested It block, so only 
way left to do this kind of works
   ```go
   var entries []table.TableEntry
   table.DescribeTable("verify and delete route data",
func(tc base.HttpTestCase) {
base.RunTestCase(tc)
},
entries...,
)
   ```
   Is to update the entries using `BeforeEach` block (which will eventually 
involve sending a multipart form request & and get request) for each entry in 
the entries slice, which is a poor design choice as it doesn't need to be 
executed that many times.
   
   So, now I'm out of ideas here. Any help would be really helpful. Thanks.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] bisakhmondal commented on pull request #1583: fest: rewrite e2e test(route_import_test) with ginkgo

2021-03-15 Thread GitBox


bisakhmondal commented on pull request #1583:
URL: https://github.com/apache/apisix-dashboard/pull/1583#issuecomment-799597937


   >Could you share us the benefits of using this lib? 
   
   Hi, @nic-chen, thanks for being interested. The gomega is just a bit fancier 
assertion tool developed by the same guy "onsi" who developed ginkgo. The extra 
benefit is that assertions are more BDD style.  It provides a lot of cool 
matchers to make the tests more readable.
   for eg: (I used here a few)
   ```go
   gomega.Expect(err).To(gomega.BeNil())
   gomega.Expect(status).To(gomega.Equal(http.StatusOK))
   gomega.Expect(list).Should(gomega.HaveLen(3))
   ```
   etc.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [apisix-dashboard] bisakhmondal commented on pull request #1583: fest: rewrite e2e test(route_import_test) with ginkgo

2021-03-14 Thread GitBox


bisakhmondal commented on pull request #1583:
URL: https://github.com/apache/apisix-dashboard/pull/1583#issuecomment-798957791


   Thank you @membphis :)
   
   It seems few recently added tests are failing. I am going to push the 
changes really soon after rechecking the code.
   
   Btw, I have a small query. Here I have used 
[`gomega`](https://onsi.github.io/gomega/) with ginkgo as a matcher library (as 
they are widely used as a combo for being more bdd style), will that be okay, 
or I should stick with the assert package that is currently being used?
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org