-
Notifications
You must be signed in to change notification settings - Fork 94
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 suite freeze on non-existent xtrigger #3056
Conversation
Looks like CI test failure is expected after this change? Is it possible to add the required dependency so the test can pass? |
Funny, @dwsutherland didn't add any Kafka dependency in his commits. I wonder why Travis is complaining about it now :S |
@dwsutherland can correct me if I am wrong. It probably wasn't checking for it before? If I understand this change correctly, it now checks that the xtrigger function is correctly imported and callable. So if Kafka is not installed, this will cause validation to fail? |
That's correct, it wasn't checking those before. I'll have a closer look at the failures.. |
So that 04-builtin-suites.t, gathers all suites and validates them... But it also includes that kafka suite: So why do we include test suites where the software isn't available? So should certain suites be excluded from tests, or the tests include more software? |
Ah, that's exactly why the kafka xtrigger example was kept under |
I guess if it only validated them (not ran them), then this wouldn't have been the cause of hanging CI tests. |
(have been asked to attend to late timesheets first, grrr...) |
@hjoliver maybe we can simply ignore kafka suites for now in the validate test, adding a This diff makes the tests pass in my environment. It ignores the Kafka almost in the same manner it ignores already empy tests if no dependency installed (tests which are broken by the way, sending a pull request for it in a bit). diff --git a/tests/validate/04-builtin-suites.t b/tests/validate/04-builtin-suites.t
index dd773fbb4..2622189fc 100755
--- a/tests/validate/04-builtin-suites.t
+++ b/tests/validate/04-builtin-suites.t
@@ -53,6 +53,11 @@ for suite in ${SUITES[@]}; do
skip 2 "${TEST_NAME}: EmPy not installed"
continue
fi
+ # ignore kafka suites TODO: revisit it later (kafka dependency)
+ if [[ $suite == *"kafka"* ]]; then
+ skip 2 "${TEST_NAME}: Skipping suites using Kafka dependencies"
+ continue
+ fi
run_ok "${TEST_NAME}" cylc validate "${suite}" -v
filter_warnings "${TEST_NAME}.stderr"
cmp_ok "${TEST_NAME}.stderr.processed" /dev/null Running:
|
@kinow - yes, that's exactly what I was thinking too. @dwsutherland - can you implement the "ignorage" on this branch? |
Done. Thanks @kinow! |
Funny, did a |
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.
LGTM, thanks @dwsutherland.
(Approving pending Travis CI result...)
(Note that SuiteConfigError is changed by #2995 ... but this PR will probably go in first). |
Yay .. chunk 4 passed. |
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.
LGTM ! 💥
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.
Actually we should have tests for this. An integration test would be easy enough (a suite that defines a non-existent trigger function should fail validation) but does this fall into the category of stuff we should really be using unit tests for? - can you advise @kinow?
Oh, just realized @matthewrmshin was also in the list of reviewers. Sorry if I merged it too quickly! |
Too late, just merged it, sorry! 😞 I think it could be tested with unit tests. We can verify that xtriggers work with the current tests, and do the negative tests with subunit + mocking IMHO. |
As described in this issue:
#3054
Problem
The suite freezes completely when a xtrigger is declared with a non-existent function (i.e. a misspell of
wall_clock
aswallclock
).. This can be devastating, as the only course of action is to kill the suite program/process via the OS...Solution
This change will:
Given the following suite section:
You can expect the following on error: