Adding explicit call for apicast-production metrics#1017
Adding explicit call for apicast-production metrics#1017cathal-bailey wants to merge 1 commit into3scale-qe:mainfrom
Conversation
251432f to
2a799d4
Compare
| service = application.service | ||
| version = service.proxy.list().configs.latest()["version"] | ||
| service.proxy.list().promote(version=version) |
There was a problem hiding this comment.
not liking this code reminded me that .promote on a apicast-production will cause restart of apicast, which can affect running tests in parallel, so apicast-production would need to set pytest.mark.disruptive
There was a problem hiding this comment.
Okay understood, my thinking is that .promote is required to in order for the GET request to work.
So would it be safer to split-out test for production metrics and mark disruptive to facilitate the .promote? I think we can leave staging as is, there doesn't seem to be any issues there atm.
There was a problem hiding this comment.
why do you need to promote it by hand? cant you just use api_client or prod_client (depenging on request.param)?
It might be better to just call either way and add # TODO: and github issue to look at this closer later.
| # Check if already promoted | ||
| prod_config = app.service.proxy.list().configs.latest(env="production") | ||
| if prod_config is None or prod_config["version"] != version: | ||
| app.service.proxy.list().promote(version=version) |
There was a problem hiding this comment.
I would not change this, prod_client should throw exception if promote=True and it was already promoted.
this is used across whole testsuite and this behavior should stay as is.
There was a problem hiding this comment.
Gotcha, this change is a proposed fix for an issue I was seeing when I ran the test locally. test_apicast_status_metrics was failing with as it tried to promote production metrics that had already been promoted by metrics. The prod_client change resolved this. I'll add this check into the test file instead so I don't have to touch the contest.py.
935d7e8 to
f27a4c1
Compare
- Mark apicast-production parameter as disruptive in metrics fixture - Use prod_client fixture for production promotion instead of manual code - Skip re-promotion in test_apicast_status_metrics with promote=False
ac46efc to
245a26f
Compare
Uh oh!
There was an error while loading. Please reload this page.