Skip to content

Ensure that a CustomExecutionTrait's teardown logic occurs _after_ nested tests run. #526

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

grynspan
Copy link
Contributor

@grynspan grynspan commented Jul 8, 2024

This PR reorders operations in Runner such that a test with a custom execution trait will execute operations in this order:

  1. Custom execution trait "before" logic;
  2. Test logic;
  3. Child test logic; and finally
  4. Custom execution trait "after" logic.

There is currently a bug here where child test logic runs after the custom execution trait runs its "after" logic, which is not intentional.

Resolves rdar://125115497.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

…nested tests run.

This PR reorders operations in `Runner` such that a test with a custom execution
trait will execute operations in this order:

1. Custom execution trait "before" logic;
1. Test logic;
1. Child test logic; and finally
1. Custom execution trait "after" logic.

There is currently a bug here where child test logic runs _after_ the custom
execution trait runs its "after" logic, which is not intentional.

Resolves rdar://125115497.
@grynspan grynspan added the bug 🪲 Something isn't working label Jul 8, 2024
@grynspan grynspan changed the title Ensure that a CustomExecutionTrait's teardown logic occurs _after_ … Ensure that a CustomExecutionTrait's teardown logic occurs _after_ nested tests run. Jul 8, 2024
@grynspan
Copy link
Contributor Author

grynspan commented Jul 8, 2024

@swift-ci please test

Copy link
Contributor

@dennisweissmann dennisweissmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Jonathan! That looks great!

@grynspan
Copy link
Contributor Author

grynspan commented Jul 8, 2024

@swift-ci please test

Copy link
Contributor

@stmontgomery stmontgomery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks, pending that stray print removal

@grynspan
Copy link
Contributor Author

grynspan commented Jul 8, 2024

@swift-ci please test

@grynspan grynspan force-pushed the jgrynspan/125115497-fix-order-of-custom-execution-trait-operations branch from 30613ff to 4fa783e Compare July 8, 2024 19:57
@grynspan
Copy link
Contributor Author

grynspan commented Jul 8, 2024

@swift-ci please test

@grynspan grynspan merged commit e678d1b into main Jul 9, 2024
3 checks passed
@grynspan grynspan deleted the jgrynspan/125115497-fix-order-of-custom-execution-trait-operations branch July 9, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants