-
Notifications
You must be signed in to change notification settings - Fork 431
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
fix: improve backend testsuite #1120
Conversation
…board. start to fix gcp prices
Can I help you? |
@shavidze yes please. Do you think my observations are right? Or is there something else wrong with the GCP pricing tests? |
Just for references: this PR introduced the above mentioned mapping and it seemed to have worked fine back then #652 |
@Traxmaxx I will take a look. |
@shavidze me and @mlabouardy came to the conclution that the pricemapping indeed changed. There are more types to update and we should rethink maybe if we really want to test all prices so detailed or if we should just check for a value greater than |
So that should be all for |
Hey @Traxmaxx there are some frontend changes too included in the PR please confirm if you want to include in this PR and let me know when I can test this... Excited! |
@AvineshTripathi its ready. I was just fixing test and lint errors in the frontend so the PR is green! |
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.
@Traxmaxx great work man! I didnt see anything more in that to review. Although I wanted to ask if we should move pricing logic of gcp inside something like /utils/pricing/gcp
and structurize file structure in that more for maintaining
So what is the status of this PR? Anything else I should change? |
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.
All good :)
Problem
The testsuite in CI/CD and localy currently reports
Solution
Tests are executed like
go test -v $(go list ./... | grep -v /dashboard/)
and this is suppossed to work fine, however for unknown reasons it does not when executed through theMakefile
. Updating the command togo test ./... | grep -v /dashboard/
and pipe the ignore filter instead works more reliablyChanges Made
Makefile
to execute all found tests except inside/dashboard
folderCONTRIBUTING.md
machine_test.go
and refactor how to test because previously we were mapping against a fixed price. I presume (actually it's hope) that the schema changes less often than the prices. I made the tests more dry and only check if the price returned is above a certain number. The number is currently set to0
.How to Test
make test
orgo test ./... | grep -v /dashboard/
Screenshots
Notes
There are test fixes in here as well.
For example
/utils/gcpcomputepricing
was broken. It seems like Google updated their pricing structure?Comparing our current
VmsOnDemandMemoryPerGb
type with the content returned from gcp-compute.json it seems they now nestVmimagee2RAME2
instance type underE2
(sdee screenshot attached).I updated the types being used in the utils test and the test now passes without error.
Before the tests where returning
Also check comment thread please.
Checklist
Reviewers
@[username of the reviewer]