-
Notifications
You must be signed in to change notification settings - Fork 93
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
Added before/after methods and test duration + deployment tests #1369
Conversation
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.
@sebjulliand Looking good to me - but can you provide me with some before
and after
methods to use for testing the code?
Sure! I was keeping them in another PR for the deployment tests; but I can
put a few of these tests in these PR 😉
|
There you go @chrjorgensen ; I added the Deployment test suite as well. |
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.
@sebjulliand before
and after
methods tested and works perfectly - of course! 😉
However, the deployment
tests fails (probably okay, since no workspace folder were configured), but the tests in the deployment
suite disappears from the tests tree:
@chrjorgensen that was the point: if the |
@sebjulliand The tests were shown before they were activated, and then they were gone - which is/was confusing to me. Now that you explain why, I see what you're trying... is it possible to show the tests in grey or have an icon to show they were not run? |
Great idea, as always! I'll do that! |
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.
@sebjulliand Beautiful - just what I wanted:
👌
However, I tried adding before
and after
to the ContentSuite testsuite, and when I throw an error in before
, the test tree does not look correct?
???
Interesting case! I didn't know you could just throw a string like that. I always threw an Error so far.
So just throwing a string would result in no failure message being retrieved, and so the test case would not be considered as having failed. It should be OK now. I also made the test suite icon a spinning gear when running (because I like it) and also turned on the |
Good question! |
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.
Perfect, Seb! 😍
Approved and merged...
Changes
This PR enhances the test framework.
Deployment tests (requires an opened workspace folder)
Deploy all
testDeploy compare
testTest suite level
before
method: if present, runs code before the test suite is executed and cancels the whole suite if it fails. The failure is displayed as a tooltip in the Tests browser.after
method: if present, runs unconditionally after the test suite is done running (even if cancelled)status
fieldTest case level
duration
field, filled when the test case is done. The duration is displayed as a tooltip in the Tests browser.Tests view
Collapse All
buttonError
Checklist