[GSoC 2026] Question regarding Globally Scoped Traits for Swift Testing

Hi team,

I’m a student interested in applying for GSoC 2026, and this project caught my attention. I’ve been exploring the swift-testing codebase and after reading the Trait protocol I had a few questions:

  • Regarding the runtime configuration schema, should the globally scoped traits be consumed before the test plan is built, which would influence the trait attachment during discovery, or will it be applied as a post-processing step after the plan is constructed?
  • Are there any existing patterns in the codebase that I should study as a reference for how the configuration would be consumed at runtime via swift test?
  • Lastly, for the experimental flag implementation, should I follow the existing experimental patterns already given in the codebase?

Thank you so much for taking the time to read this. I’m excited to contribute to Swift Testing and learning from the community. I’d really appreciate any guidance from @jerryjrchen and the team as I explore the codebase and work toward a meaningful contribution. :)))

1 Like

Welcome, and thanks for checking out the proposal!

I think you will want to look at SwiftPM's codebase for some of those examples. I'm admittedly not too familiar with it myself, so let me know if that seems to be a dead end.

I think yes, although it would be easier to confirm once we're looking at a concrete set of changes.

I know you had one more question there. I'll respond to that later, after I've had a chance to look more at that part of our codebase!

2 Likes

Thanks for directing me towards SwiftPM! I'm currently working through the Runner and trait system in swift-testing first to better understand the integration point before diving into SwiftPM. Does that seem like the right approach?

Regarding my first question, after reading through Runner.swift, I noticed that the traits are being applied is applyScopingTraits() which is called after the plan is already built. This suggests that the globally scoped traits would most likely be integrated at the Configuration level before run() starts, rather than a post processing step. Would this match your thinking?

Other than that, I also noticed that Configuration is accessed as a task-local value throughout the runner. Would globally scoped traits essentially set defaults on this Configuration object before the Runner is initialised, with per-test traits still being able to override them?

Hmm, are you think of something along the lines of adding a traits property to the config?

Yes, being able to override the defaults per-test would be important to support. I also suspect this would be easier to do so if we start from the Configuration level as you suggest.

1 Like

Yep, that is where my thought process lies. Really appreciate your guidance! :)