-
Notifications
You must be signed in to change notification settings - Fork 837
Improve utilities for E2E tests. #251
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
Conversation
* Define a wrap_test function that takes care of some of the repitive work
of configuring a TestCase object.
* Define a TestSuite class to represent more than 1 TestCase.
* This should make it easy to define a suite of TestCases ahead of time
so that if we abort early, the junit file will still have an entry for
all test cases even the ones that didn't get run.
* airflow.py should set the logging formatter for the logger that logs to a
file. The file handler doesn't appear to pick up the BasicConfig.
1 similar comment
| from py import util | ||
|
|
||
| # TODO(jlewi): How can we indicate that a test wasn't run? | ||
| class TestCase(object): |
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.
library suggestion: https://github.com/python-attrs/attrs or namedtuple
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.
I meant in the junit.xml file that is created and uploaded to gubernator.
I ended up marking the test as failed with a failure message of "Test not run."
PTAL>
| "Timeout waiting for deployment {0} in namespace {1}".format( | ||
| name, namespace)) | ||
|
|
||
| def wait_for_statefulset(api_client, namespace, name): |
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.
I have this feeling that wait for $resource_type to be $ready|created|deleted is commonly used and repeatedly reimplemented in both Python and Golang
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.
Probably. Do you know if there is a common library somewhere?
|
@jimexist anymore comments? |
|
@jlewi not really. regarding the repeated code patterns I only thought that certain functions can live in its own (python) package in order to facilitate any code trying to test against k8s server. |
Signed-off-by: konflux-internal-p02 <170854209+konflux-internal-p02[bot]@users.noreply.github.com> Co-authored-by: konflux-internal-p02[bot] <170854209+konflux-internal-p02[bot]@users.noreply.github.com>
Define a wrap_test function that takes care of some of the repitive work
of configuring a TestCase object.
Define a TestSuite class to represent more than 1 TestCase.
so that if we abort early, the junit file will still have an entry for
all test cases even the ones that didn't get run.
airflow.py should set the logging formatter for the logger that logs to a
file. The file handler doesn't appear to pick up the BasicConfig.
This change is