exercism / scala

Exercism exercises in Scala.
https://exercism.org/tracks/scala
MIT License
123 stars 131 forks source link

Matching Brackets funsuite errors #714

Closed bobahop closed 2 years ago

bobahop commented 2 years ago

I saw that Matching Brackets was outdated, so I updated the solution and it failed the current tests, so I downloaded it and it now reports 63 errors in MatchingBracketsTest,scala related to funsuite not being part of scalatest and a bunch of missing values. This was after importing new definitions when prompted by vscode. Doing that has never caused me problems before.

ErikSchierboom commented 2 years ago

Must be related to https://github.com/exercism/scala/pull/712. @CJSmith-0141 thoughts?

CJSmith-0141 commented 2 years ago

Are you using sbt to manage your dependencies? If you downloaded just the *Test.scala file without the updated build.sbt it would for sure break.

CJSmith-0141 commented 2 years ago

There are also breaking changes from Scala 2.12 to 2.13, so there very well could be broken things in the solution as well.

ErikSchierboom commented 2 years ago

We might have been bitten by the fact that we don't have proper track CI for Scala. I'll put it on my todo list.

bobahop commented 2 years ago

Are you using sbt to manage your dependencies?

I have sbt installed. Usually when some kind of update is needed vscode prompts whether I want to "import new build whatever" (I don't remember the exact working.). I click "yes" and it usually works, but not this time.

A this point all 63 errors are from the test file; none from the solution file.

bobahop commented 2 years ago

If you downloaded just the *Test.scala file without the updated build.sbt it would for sure break.

Here is the contents of build.sbt

scalaVersion := "2.13.6"

libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.10" % "test"
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.5"

info after clicking Import Changes This is the result info_1

Here is the log info

2022.02.11 10:28:28 INFO  running 'C:\Program Files\Microsoft\jdk-16.0.1.9-hotspot\bin\java -Djline.terminal=jline.UnsupportedTerminal -Dsbt.log.noformat=true -Dfile.encoding=UTF-8 -jar C:\Users\bobah\AppData\Local\Temp\metals13463895331810464785\sbt-launch.jar -Dbloop.export-jar-classifiers=sources bloopInstall'
2022.02.11 10:28:30 INFO  [info] welcome to sbt 1.5.4 (Microsoft Java 16.0.1)
2022.02.11 10:28:30 INFO  [info] loading settings for project matching-brackets-build-build from metals.sbt ...
2022.02.11 10:28:31 INFO  [info] loading project definition from C:\Users\bobah\Exercism\scala\matching-brackets\project\project
2022.02.11 10:28:31 INFO  [info] loading settings for project matching-brackets-build from metals.sbt ...
2022.02.11 10:28:33 INFO  [info] loading project definition from C:\Users\bobah\Exercism\scala\matching-brackets\project
2022.02.11 10:28:35 INFO  [success] Generated .bloop\matching-brackets-build.json
2022.02.11 10:28:35 INFO  [success] Total time: 3 s, completed Feb 11, 2022, 10:28:35 AM
2022.02.11 10:28:37 INFO  [info] loading settings for project matching-brackets from build.sbt ...
2022.02.11 10:28:37 INFO  [info] set current project to matching-brackets (in build file:/C:/Users/bobah/Exercism/scala/matching-brackets/)
2022.02.11 10:28:37 INFO  [warn] 
2022.02.11 10:28:37 INFO  [warn]    Note: Unresolved dependencies path:
2022.02.11 10:28:37 INFO  [error] sbt.librarymanagement.ResolveException: Error downloading org.scala-lang.modules:scala-parser-combinators_2.13:1.0.5
2022.02.11 10:28:37 INFO  [error]   Not found
2022.02.11 10:28:37 INFO  [error]   Not found
2022.02.11 10:28:37 INFO  [error]   not found: C:\Users\bobah\.ivy2\localorg.scala-lang.modules\scala-parser-combinators_2.13\1.0.5\ivys\ivy.xml
2022.02.11 10:28:37 INFO  [error]   not found: https://repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.13/1.0.5/scala-parser-combinators_2.13-1.0.5.pom
2022.02.11 10:28:37 INFO  [error]   at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:258)
2022.02.11 10:28:37 INFO  [error]   at lmcoursier.CoursierDependencyResolution.$anonfun$update$38(CoursierDependencyResolution.scala:227)
2022.02.11 10:28:37 INFO  [error]   at scala.util.Either$LeftProjection.map(Either.scala:573)
2022.02.11 10:28:37 INFO  [error]   at lmcoursier.CoursierDependencyResolution.update(CoursierDependencyResolution.scala:227)
2022.02.11 10:28:37 INFO  [error]   at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:60)
2022.02.11 10:28:37 INFO  [error]   at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:59)
2022.02.11 10:28:37 INFO  [error]   at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:133)
2022.02.11 10:28:37 INFO  [error]   at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:73)
2022.02.11 10:28:37 INFO  [error]   at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$20(LibraryManagement.scala:146)
2022.02.11 10:28:37 INFO  [error]   at scala.util.control.Exception$Catch.apply(Exception.scala:228)
2022.02.11 10:28:37 INFO  [error]   at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:146)
2022.02.11 10:28:37 INFO  [error]   at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:127)
2022.02.11 10:28:37 INFO  [error]   at sbt.util.Tracked$.$anonfun$inputChangedW$1(Tracked.scala:219)
2022.02.11 10:28:37 INFO  [error]   at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:160)
2022.02.11 10:28:37 INFO  [error]   at sbt.Classpaths$.$anonfun$updateTask0$1(Defaults.scala:3678)
2022.02.11 10:28:37 INFO  [error]   at scala.Function1.$anonfun$compose$1(Function1.scala:49)
2022.02.11 10:28:37 INFO  [error]   at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
2022.02.11 10:28:37 INFO  [error]   at sbt.std.Transform$$anon$4.work(Transform.scala:68)
2022.02.11 10:28:37 INFO  [error]   at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
2022.02.11 10:28:37 INFO  [error]   at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
2022.02.11 10:28:37 INFO  [error]   at sbt.Execute.work(Execute.scala:291)
2022.02.11 10:28:37 INFO  [error]   at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
2022.02.11 10:28:37 INFO  [error]   at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
2022.02.11 10:28:37 INFO  [error]   at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
2022.02.11 10:28:37 INFO  [error]   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
2022.02.11 10:28:37 INFO  [error]   at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
2022.02.11 10:28:37 INFO  [error]   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
2022.02.11 10:28:37 INFO  [error]   at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
2022.02.11 10:28:37 INFO  [error]   at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
2022.02.11 10:28:37 INFO  [error]   at java.base/java.lang.Thread.run(Thread.java:831)
2022.02.11 10:28:37 INFO  [error] (update) sbt.librarymanagement.ResolveException: Error downloading org.scala-lang.modules:scala-parser-combinators_2.13:1.0.5
2022.02.11 10:28:37 INFO  [error]   Not found
2022.02.11 10:28:37 INFO  [error]   Not found
2022.02.11 10:28:37 INFO  [error]   not found: C:\Users\bobah\.ivy2\localorg.scala-lang.modules\scala-parser-combinators_2.13\1.0.5\ivys\ivy.xml
2022.02.11 10:28:37 INFO  [error]   not found: https://repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.13/1.0.5/scala-parser-combinators_2.13-1.0.5.pom
2022.02.11 10:28:37 INFO  [error] Total time: 1 s, completed Feb 11, 2022, 10:28:38 AM
2022.02.11 10:28:38 INFO  time: ran 'sbt bloopInstall' in 10s
2022.02.11 10:28:38 INFO  Disconnecting from Bloop session...
2022.02.11 10:28:38 ERROR sbt command failed: C:\Program Files\Microsoft\jdk-16.0.1.9-hotspot\bin\java -Djline.terminal=jline.UnsupportedTerminal -Dsbt.log.noformat=true -Dfile.encoding=UTF-8 -jar C:\Users\bobah\AppData\Local\Temp\metals13463895331810464785\sbt-launch.jar -Dbloop.export-jar-classifiers=sources bloopInstall
2022.02.11 10:28:38 INFO  Shut down connection with build server.
2022.02.11 10:28:38 INFO  Shut down connection with build server.
2022.02.11 10:28:38 INFO  Attempting to connect to the build server...
2022.02.11 10:28:38 INFO  tracing is disabled for protocol BSP, to enable tracing of incoming and outgoing JSON messages create an empty file at C:\Users\bobah\Exercism\scala\matching-brackets\.metals\bsp.trace.json or C:\Users\bobah\AppData\Local\scalameta\metals\cache\bsp.trace.json
2022.02.11 10:28:38 INFO  Attempting to connect to the build server...
2022.02.11 10:28:38 INFO  tracing is disabled for protocol BSP, to enable tracing of incoming and outgoing JSON messages create an empty file at C:\Users\bobah\Exercism\scala\matching-brackets\project\.metals\bsp.trace.json or C:\Users\bobah\AppData\Local\scalameta\metals\cache\bsp.trace.json
2022.02.11 10:28:38 INFO  time: Connected to build server in 69ms
2022.02.11 10:28:38 INFO  Connected to Build server: Bloop v1.4.12
2022.02.11 10:28:40 INFO  time: indexed workspace in 1.39s
2022.02.11 10:29:26 INFO  compiling matching-brackets-test (1 scala source)
2022.02.11 10:29:26 INFO  time: compiled matching-brackets-test in 0.28s

The problem seems to be here

Note: Unresolved dependencies path:
2022.02.11 10:28:37 INFO  [error] sbt.librarymanagement.ResolveException: Error downloading org.scala-lang.modules:scala-parser-combinators_2.13:1.0.5
2022.02.11 10:28:37 INFO  [error]   Not found
2022.02.11 10:28:37 INFO  [error]   Not found
2022.02.11 10:28:37 INFO  [error]   not found: C:\Users\bobah\.ivy2\localorg.scala-lang.modules\scala-parser-combinators_2.13\1.0.5\ivys\ivy.xml
bobahop commented 2 years ago

The only folder I have under .ivy2 is a cache folder. Not that I want even more, um, stuff, loaded onto my hard drive.

CJSmith-0141 commented 2 years ago

@bobahop can you try removing

libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.5"

from build.sbt and see if that fixes the unresolved dependency?

bobahop commented 2 years ago

Commenting out the parser line from build.sbt gets this when running all tests

Run completed in 384 milliseconds.
[info] Total number of tests run: 15
[info] Suites: completed 1, aborted 0                                                                                              
[info] Tests: succeeded 15, failed 0, canceled 0, ignored 0, pending 0                                                             
[info] All tests passed.         

So that works. 😄

CJSmith-0141 commented 2 years ago

Cool I made a PR that makes that change and an identical change in a couple other places. https://github.com/exercism/scala/pull/715