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

Global setup exception does not contain the TestCaseId #167

Closed
shaun-od opened this issue Apr 2, 2024 · 3 comments · Fixed by #168
Closed

Global setup exception does not contain the TestCaseId #167

shaun-od opened this issue Apr 2, 2024 · 3 comments · Fixed by #168

Comments

@shaun-od
Copy link

shaun-od commented Apr 2, 2024

Describe the bug
When an exception is thrown in the lifecycle method SailfishGlobalSetup the exception appears in the CompiledTestCaseResult but without a TestCaseId.

To Reproduce
Steps to reproduce the behavior:

  1. Run the existing Sailfish Test GlobalSetupExceptionsAreHandled
  2. Check the result object returned result.ExecutionSummaries[0].CompiledTestCaseResults[0].TestCaseId is null

Expected behavior
I would expect the test invoked when the setup method is being called that throws the exception, would be included in the returned object.

@shaun-od
Copy link
Author

shaun-od commented Apr 2, 2024

Looking at the code, I think this is because the method CatchAndReturn in the SailfishExecutionEngine creates and returns a TestCaseExecutionResult using the constructor that takes just the exception.

Couldn't it create a new TestCaseExecutionResult using the preexisting constructor that allows the TestInstanceContainer and Exception to be passed in?

@paulegradie
Copy link
Owner

paulegradie commented Apr 6, 2024

Thanks @shaun-od I'll address this today. Let me know if you're planning on putting up a PR 🙏

@paulegradie
Copy link
Owner

paulegradie commented Apr 6, 2024

using the preexisting constructor that allows the TestInstanceContainer and Exception to be passed in

Yes - this is the way 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants