-
Notifications
You must be signed in to change notification settings - Fork 3.1k
In-source partest [ci: last-only] #6566
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
|
This is ready to be reviewed (by everyone for the change in general, @szeiger could take a special look at |
build.sbt
Outdated
| // two lines below are copied over from sbt's sources: | ||
| // https://github.com/sbt/sbt/blob/0.13/main/src/main/scala/sbt/Defaults.scala#L628 | ||
| //val resolvedScalaVersion = ScalaVersion((scalaVersion in artifactName).value, (scalaBinaryVersion in artifactName).value) | ||
| //val resolvedScalaVersion = ScalaVersion((scalaVersion in artifactName).value, (scalapartVersion in artifactName).value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find&replace error?
| description := "Scala Compiler Testing Tool (compiler-specific extras)", | ||
| libraryDependencies += partestDep, | ||
| unmanagedSourceDirectories in Compile := List(baseDirectory.value) | ||
| name := "scala-partest", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intended to switch the group ID from org.scala-lang.modules to org.scala-lang? Otherwise an organization setting should be added.
You probably want to add the usual boilerplate from the other published projects, too:
.settings(generatePropertiesFileSettings)
.settings(Osgi.settings)
.settings(AutomaticModuleName.settings("scala.partest"))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question about the group ID. It seems more consistent to me to switch to org.scala-lang.
Thanks for the other suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generatePropertiesFileSettings is part of configureAsSubproject, so that's redundant (no?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other projects mention it, too, but it should be redundant. We can remove it everywhere.
895f46d to
e02c2ca
Compare
|
Welcome back home, partest. |
|
Is there a reason that the partest git history isn't being preserved here? I guess the |
|
Rebased
By adding another root to the git repository using |
yes, that's what I meant. I'm not aware of any downsides caused by intentional use of it; the git release note for this flag appears to imply that it's there to ensure you know what you're doing. I've merged many projects together this way at work and haven't seen any problems yet. Besides, given how |
|
FWIW, scala-js/scala-js has had two roots for 5 years without any problem. In one of the branches it shares history with https://github.com/sjrd/ozma. I don't think anyone even noticed :p |
|
OK, I'll probably only get to look into this next week, this week is 🌴 🏖 👨👩👧👦 If someone else is giving it a go, please drop a note here |
That was before we merged collection-strawman. Now it has three. |
Really? Interesting. What's the other-other one? |
|
See 878e7d3 for the collection-strawman migration script. The gist: Pull a branch from the repo you want to merge, start a "fake" merge ( There's a catch however: Partest was originally part of scala/scala but apparently got its history rewritten and rebased when it was pulled out into a separate repo. It should be possible to revert this by taking the first commit after the split and rebasing it on top of the version of its parent that is still in scala/scala. This will make the version that we merge back merge-incompatible with the partest repo but if we don't rebase first we end up with two merge-incompatible histories of partest in scala/scala. |
|
(see |
👍 I documented how I re-in-sourced part of sbt/util back into sbt/sbt over in sbt/sbt#3302. |
|
Is this good to go? |
d3c5a60 to
ffa2fbd
Compare
|
Pushed the partest history that went into scala-partest between the module creation and now. So there's no new root in the git repository in the end. Here's the log:
OK that looks good. So we use 3946e12 as the scala/scala commit where partest was branched off. Rewrite the history so that the sources are always in The branch off commit ("Spin off parser combinators") is now lrytz/scala-partest@09be915c46. First we restore Then we add the commits from scala-partest on top: Diffing to make sure all is correct Push to the PR |
I think now it is |
Conventionally, a multiline file means take each line as an element, no quote parsing required. To support trailing spaces, do not aggressively trim the input; that was probably to avoid confusion over a nonempty line consistently only of spaces; but still do drop empty elements, that is, a line of zero length. An empty line is useful to force multiline handling of a single element. (A single line is split on space.)
See scala#6164 Ref scala/scala-dev#461 (still need to release partest & upgrade)
The cost of VM startup and JIT is the predominant reason that
`partest --run` is slow. We're much better of using one thread
on the main JVM to execute these tests.
This commit uses such a mode under a non-default option.
Unforked test execution requires some care:
- we need to check the main JVM is started with the mandated
immutable System properties (e.g. file.encoding)
- other test-specific system properties (e.g. partest.output)
need to be patched into the system property map before
each test is executed.
- sys.exit calls need to be intercepted with a security manager
- stdout / stderr need to be intercepted, both in the Java and
Scala console printing APIs.
Some tests need to be adapted, in particular those that assume
that java.class.path will contain the test classes.
Tests can also force usage of the legacy forked mode by adding
a .javaopts file with a dummy JVM option.
Also improve recording of test durations and flag slow tests in
console output.
- Comment for Stopwatch - Delete commented out debug code - Refactor properties save/restore - DRY up console scraping
We fork a process with a process logger that redirects
stdout and stderr to a log file, so I can't see why this
was ever needed.
Tested:
```
Note: test execution will be non-parallel under -Dpartest.exec.in.process
% scalac t1459/InheritingPrinter.scala t1459/JavaPrinter.java t1459/ScalaPrinter.scala t1459/Test.java t1459/VarArg.java
!! 1 - run/t1459 [compilation failed]
% scalac t1459/InheritingPrinter.scala t1459/JavaPrinter.java t1459/ScalaPrinter.scala t1459/Test.java t1459/VarArg.java
JavaPrinter.java:1: error: illegal start of type declaration
public cla ss JavaPrinter implements VarArg {
^
one error found
partest --update-check \
/Users/jz/code/scala/test/files/run/t1459
```
Fixes the regression when running under `--verbose` ``` % scalac innerClassEnclMethodJavaReflection.scala % <in process execution of jvm/innerClassEnclMethodJavaReflection.scala> > innerClassEnclMethodJavaReflection-jvm.log % diff /Users/jz/code/scala/test/files/jvm/innerClassEnclMethodJavaReflection-jvm.log /Users/jz/code/scala/test/files/jvm/innerClassEnclMethodJavaReflection.check--- innerClassEnclMethodJavaReflection-jvm.log +++ empty @@ -1,3 +1,0 @@ -% scalac unreachable/Foo_1.scala -% scalac t2470/Test_1.scala -% scalac t2470/Read_Classfile_2.scala ```
Now that scala#6255 is merged
|
Start at the branching point Add the commits from scala-partest Merge into 2.13.x Compare against the version that was initially in this PR (without history) Get the remaining commits @szeiger does that look good? |
|
(Sorry, my paradise in-source PR caused a conflict) |
|
Jenkins is green, shall we merge? |
|
I'd like Stefan to sign it off |
|
LGTM |
|
🎉 been wanting this for years |
No description provided.