Skip to content
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

Log exceptions thrown when executing debug of FW tests #922

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,30 +56,37 @@ public Iterable<Class<?>> getSuites() {

@Override
public RunResult invoke(Object o) throws TestSetFailedException, ReporterException, InvocationTargetException {
var bootstrap = new QuarkusScenarioBootstrap();
var testContext = new TestContext.TestContextImpl(findTestClass(), Set.of());
var testClassInstance = instantiateTestClass();

bootstrap.beforeAll(testContext);
invokeTestBeforeAll(testClassInstance);
if (runTests) {
// beforeEach methods are called before test
runTests(testClassInstance, bootstrap, testContext);
} else {
invokeTestBeforeEach(testClassInstance);
bootstrap.beforeEach(testContext, findTestMethod());
}
try {
var bootstrap = new QuarkusScenarioBootstrap();
var testContext = new TestContext.TestContextImpl(findTestClass(), Set.of());
var testClassInstance = instantiateTestClass();

bootstrap.beforeAll(testContext);
invokeTestBeforeAll(testClassInstance);
if (runTests) {
// beforeEach methods are called before test
runTests(testClassInstance, bootstrap, testContext);
} else {
invokeTestBeforeEach(testClassInstance);
bootstrap.beforeEach(testContext, findTestMethod());
}

waitTillUserWishesToExit();
waitTillUserWishesToExit();

if (!runTests) {
bootstrap.afterEach();
invokeTestAfterEach(testClassInstance);
if (!runTests) {
bootstrap.afterEach();
invokeTestAfterEach(testClassInstance);
}
invokeTestAfterAll(testClassInstance);
bootstrap.afterAll();

return noTestsRun();
} catch (Throwable t) {
// this needs to be done, because the exception and message are not logged,
// instead, generic exception is provided
LOG.error("Execution failed with following exception", t);
throw t;
}
invokeTestAfterAll(testClassInstance);
bootstrap.afterAll();

return noTestsRun();
}

private Object instantiateTestClass() throws InvocationTargetException {
Expand Down