You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pbench-results-push: logging fixes and better reporting (#3348)
* Do not use the file logger at all in python commands.
The logger only uses the default Streamhandler now which outputs to stderr.
* - copy_result_tb: return the response to the PUT request
copy_result_tb returns the response from the server. The callers
are responsible for interpreting it. However, it can still raise an
exception (e.g. on connection error).
- push.py: construct a reasonable message out of the response and check
if the HTTP status is 201: we exit with 0 if so.
Otherwise, if the status is OK (i.e. < 400), then we exit with 0 but
print a message with a reasonably self-explanatory status on
stderr. We expect that we will only ever get two OK responses: a 201
which indicates a successful PUT with a newly created dataset and 200
which indicates a duplicate dataset.
In all non-OK cases, we output the message on stderr and exit with 1.
- move.py: check the response - if not OK (>= 400) raise exception.
* Fix the monkeypatching in test_copy_result_tb.py
Monkeypatching pathlib components (.exists() and .open()) causes
pytest to blow up. Limit the scope by using `monkeypatch.context()'
so that it is only applied to the objects under test (and not e.g.
to what is used in checking assertions).
* Use symbolic constant instead of explicit 201
* Parametrize the "normal" test
This is just the first step - see issue #3374 for some more work along these lines.
0 commit comments