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

testing: move Internal types to internal package #35567

Closed
bradfitz opened this issue Nov 13, 2019 · 8 comments
Closed

testing: move Internal types to internal package #35567

bradfitz opened this issue Nov 13, 2019 · 8 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. Proposal Proposal-Accepted
Milestone

Comments

@bradfitz
Copy link
Contributor

bradfitz commented Nov 13, 2019

InternalBenchmark, InternalExample, and InternalTest predate the "internal" package mechanism.

Per a discussion here, we could probably move those three into a new internal package, and add a type alias for a few cycles before removing the testing alias.

@bradfitz bradfitz added this to the Go1.15 milestone Nov 13, 2019
@andybons andybons added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 13, 2019
@andybons andybons modified the milestones: Go1.15, Backlog Nov 13, 2019
@rsc rsc added this to Incoming in Proposals (old) Nov 27, 2019
@rsc
Copy link
Contributor

rsc commented Nov 27, 2019

This seems like a likely accept given the reactions over the past two weeks.
/cc @mpvl

Leaving open for a week for final comments.

@rsc rsc changed the title testing: move Internal types to internal package proposal: testing: move Internal types to internal package Nov 27, 2019
@rsc rsc moved this from Incoming to Likely Accept in Proposals (old) Dec 4, 2019
@rsc
Copy link
Contributor

rsc commented Dec 4, 2019

No change in consensus, so accepting.

@rsc rsc changed the title proposal: testing: move Internal types to internal package testing: move Internal types to internal package Dec 4, 2019
@rsc rsc moved this from Likely Accept to Accepted in Proposals (old) Dec 11, 2019
@tpaschalis
Copy link
Contributor

tpaschalis commented May 29, 2020

Hey @bradfitz! Sorry for pinging, but I'd like to take a stab on this issue if that's okay with you!

From what I gather, we'd like move InternalBenchmark, InternalExample, and InternalTest into a new package most likely in src/internal/testing, or src/testing/internal.

Then, to avoid confusion during a couple of releases, we'd also like to alias them to their older names like type InternalBenchmark = internal.Benchmark.

I hope I'm not completely off the mark; please let me know if I've missed anything and I'll try to get a CL opened soon!

@tpaschalis
Copy link
Contributor

I tried my hand on this; moving InternalBenchmark and InternalTest meant moving types T and B and their common interface as well to avoid cyclical dependencies.

It cascades to more changes than I anticipated, but I'll still open that CL in the next days and hopefully get some feedback.

@ianlancetaylor ianlancetaylor added help wanted NeedsFix The path to resolution is known, but the work has not been done. labels Jun 15, 2020
@ianlancetaylor ianlancetaylor modified the milestones: Go1.15, Backlog Jun 15, 2020
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 15, 2020
@gopherbot
Copy link

Change https://golang.org/cl/247057 mentions this issue: testing: move Internal types to internal package

@ianlancetaylor
Copy link
Contributor

@arnottcr took a stab at this in https://golang.org/cl/247057, and the resulting change is pretty big and has ramifications like changing the names of user visible types. Unless we can find a simpler approach, I don't think we should actually do this.

@urandom2
Copy link
Contributor

While I find it problematic that one of the blocking arguments is that, type alias documentation is a bad ux and #44905 was closed without resolution; I agree this change is probably too large to justify otherwise, should we close it out?

@rsc
Copy link
Contributor

rsc commented Jul 19, 2021

I agree - we did not consider the references InternalTest -> T and InternalBenchmark -> B.
It does not make any sense to move testing.T and testing.B to another package and make them type aliases.
Let's close this.

@rsc rsc closed this as completed Jul 19, 2021
@golang golang locked and limited conversation to collaborators Jul 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. Proposal Proposal-Accepted
Projects
No open projects
Development

No branches or pull requests

7 participants