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

Unit tests aren't working on Windows 10 #547

Closed
LeonardMeyer opened this issue Jan 6, 2018 · 1 comment
Closed

Unit tests aren't working on Windows 10 #547

LeonardMeyer opened this issue Jan 6, 2018 · 1 comment

Comments

@LeonardMeyer
Copy link
Contributor

LeonardMeyer commented Jan 6, 2018

When I run unit/test with SBT I get the following errors:

[info] Compiling 1 Scala source to C:\Users\xxxx\IdeaProjects\scalafix\.cross\core\jvm\target\scala-2.12\classes...
[info] AutoClasspathSuite:
[info] - --classpath=auto (116 milliseconds)
[info] ToolClasspathTests:
[info] - --tool-classpath is respected when compiling from source *** FAILED *** (6 milliseconds)
[info]   java.lang.IllegalStateException: Type mismatch;
[info]   found    : String (value: "file:C:\\Users\\xxxx\\AppData\\Local\\Temp\\scalafix9146043757286398544FormatRule.scala")
[info]   expected : scalafix.rule.Rule
[info]   at metaconfig.Configured.get(Configured.scala:11)
[info]   at scalafix.tests.reflect.ToolClasspathTests.$anonfun$new$1(ToolClasspathTests.scala:52)
[info]   at scalafix.tests.reflect.ToolClasspathTests$$Lambda$7398/212234463.apply(Unknown Source)
[info]   at org.scalatest.OutcomeOf.outcomeOf(OutcomeOf.scala:85)
[info]   at org.scalatest.OutcomeOf.outcomeOf$(OutcomeOf.scala:83)
[info]   at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
[info]   at org.scalatest.Transformer.apply(Transformer.scala:22)
[info]   at org.scalatest.Transformer.apply(Transformer.scala:20)
[info]   at org.scalatest.FunSuiteLike$$anon$1.apply(FunSuiteLike.scala:186)
[info]   at org.scalatest.TestSuite.withFixture(TestSuite.scala:196)
[info]   ...
[info] - --tool-classpath is respected during classloading (478 milliseconds)
[info] TokenListTest:
[info] - leading returns all preceding tokens (98 milliseconds)
[info] - leading returns empty seq if there is no preceding tokens (1 millisecond)
[info] - leading fails if input token does not exist (48 milliseconds)
[info] - trailing returns all following tokens (7 milliseconds)
[info] - trailing returns empty seq if there is no following tokens (0 milliseconds)
[info] - trailing fails if input token does not exist (2 milliseconds)
[info] - find returns first token following `start` matching the predicate (4 milliseconds)
[info] - find returns `start` token if it matches predicate (2 milliseconds)
[info] - find returns none if token matching predicate comes before `start` (0 milliseconds)
[info] - find fails if `start` token does not exist (1 millisecond)
[info] - prev returns the preceding token (0 milliseconds)
[info] - prev returns self if there is no preceding token (0 milliseconds)
[info] - next returns the following token (0 milliseconds)
[info] - next returns self if there is no following token (0 milliseconds)
[info] - slice returns `from` if there is no more tokens in between (0 milliseconds)
[info] - slice returns empty seq if `from` and `to` tokens are the same object (0 milliseconds)
[info] - slice returns empty seq if `from` comes after `to` (0 milliseconds)
[info] - slice fails if `from` token does not exist (1 millisecond)
[info] - slice fails if `to` token does not exist (1 millisecond)
[info] - slice returns tokens between `from` (inclusive) and `to` (8 milliseconds)
[info] - leadingSpaces returns all spaces preceding a token (4 milliseconds)
[info] - leadingSpaces returns an empty seq if there's no space preceding a token (2 milliseconds)
[info] - trailingSpaces returns all spaces following a token (1 millisecond)
[info] - trailingSpaces returns an empty seq if there's no space following a token (1 millisecond)
[info] PatchSuite:
[info] - Input.String('<// Foobar
[info] ...>') *** FAILED *** (957 milliseconds)
[info]   "...t.String('<// Foobar[
[info]   ...>')
[info]   +++ Input.String('<// Foobar
[info]   ]...>')
[info]   @@ -1,4 +1,4 ..." did not equal "...t.String('<// Foobar[...>')
[info]   +++ Input.String('<// Foobar]...>')
[info]   @@ -1,4 +1,4 ..." (SyntacticRuleSuite.scala:42)
[info] - /label (0 milliseconds)
[info] - C:\Users\xxxx\AppData\Local\Temp\foo615380342589295636.scala (0 milliseconds)
[info] - addLeft adds the string before the first tree token (16 milliseconds)
[info] - addGlobalImporter is a syntactic patch (154 milliseconds)
[info] ErrorSuite:
[info] - on parse error (258 milliseconds)
info: Config:
 = ScalafixConfig(scala.meta.internal.parsers.ScalametaParser$$anon$189@5acec26e,DebugConfig(false),true,true,PrintStreamReporter(java.io.PrintStream@771af328,info,FilterMatcher(.*,$a),false),ConfigRulePatches(List(),List(),List()),Dialect(true, true, false, true, false, false, false, true, false, true, false, true, true, false, true, false, false, true, true, false, true, true, true, ),LintConfig(PrintStreamReporter(java.io.PrintStream@5b2aa8bd,info,FilterMatcher(.*,$a),false),false,FilterMatcher($a,$a),FilterMatcher($a,$a),FilterMatcher($a,$a),FilterMatcher($a,$a)))
Rule:
ProcedureSyntax

[info] CliArgsTest:

[info] - --zsh (772 milliseconds)


[info] - --bash (15 milliseconds)
[info] - --rules (3 seconds, 279 milliseconds)
[info] - parse (209 milliseconds)
###########> Diff       <###########

=======
=> Diff
=======
     }
-    val `?`: _root_.test.explicitResultTypes.ExplicitResultTypesBase.unicode.->.type = `->`
+    val ``: _root_.test.explicitResultTypes.ExplicitResultTypesBase.unicode.->.type = `->`
   }

[info] CliSyntacticTests:
[info] - fix file (171 milliseconds)
[info] - fix directory (51 milliseconds)
[info] - file not found (25 milliseconds)
[info] - empty rule (3 milliseconds)
[info] - --test error (19 milliseconds)
[info] - --test OK (35 milliseconds)
[info] - linter error (34 milliseconds)
[info] - linter warning promoted to error (33 milliseconds)
[info] - --exclude is respected (35 milliseconds)
[info] - --stdout does not write to file (11 milliseconds)
[info] - parse errors return exit code (9 milliseconds)
[info] - fix sbt files (103 milliseconds)
[info] - deprecated name emits warning (28 milliseconds)
[info] - no files to fix is error (11 milliseconds)
[info] - --out-from --out-to change output path (26 milliseconds)
[info] GitHubUrlRuleSuite:
[info] - github:someorg/somerepo/1.2.3 (2 milliseconds)
[info] - github:someorg/somerepo/1.2.3?sha=master~1 (0 milliseconds)
[info] - github:someorg/some-repo/1.2.3 (0 milliseconds)
[info] - github:someorg/42some-repo/1.2.3 (0 milliseconds)
[info] - FAIL github:someorg/somerepo (0 milliseconds)
[info] IntervalSetTest:
[info] - contains (4 milliseconds)
[info] - intersects (1 millisecond)
[info] SymbolMacroTest:
[info] - compile OK (11 milliseconds)
[info] - compile error (0 milliseconds)
[info] SemanticdbIndexTest:
[info] - symbol(Importee.Name) (51 milliseconds)
[info] - symbol(Type.Select) (3 milliseconds)
[info] - symbol(Term.Select) (6 milliseconds)
[info] - symbol(Importee.Rename) (5 milliseconds)
[info] DenotationOpsTest:
[info] - resultType (82 milliseconds)
[info] RuleInstrumentationTest:
[info] - lenient dialect is supported (17 milliseconds)
[info] DisableSyntaxConfigSuite:
[info] - Warn about invalid keywords (6 milliseconds)
[info] - Provide suggestions when typos are present in keywords (2 milliseconds)
[info] - Warn about wrong types (1 millisecond)
[info] - Handles non-string types (6 milliseconds)
[info] ScalafixReflectTests:
[info] - absolute path resolves as is *** FAILED *** (1 millisecond)
[info]   java.lang.IllegalStateException: Type mismatch;
[info]   found    : String (value: "file:C:\\Users\\xxxx\\IdeaProjects\\scalafix\\scalafix-tests\\unit\\src\\main\\scala\\scalafix\\test\\DummyLinter.scala")
[info]   expected : scalafix.rule.Rule
[info]   at metaconfig.Configured.get(Configured.scala:11)
[info]   at scalafix.tests.reflect.ScalafixReflectTests.$anonfun$new$1(ScalafixReflectTests.scala:29)
[info]   at scalafix.tests.reflect.ScalafixReflectTests$$Lambda$8828/907174011.apply(Unknown Source)
[info]   at org.scalatest.OutcomeOf.outcomeOf(OutcomeOf.scala:85)
[info]   at org.scalatest.OutcomeOf.outcomeOf$(OutcomeOf.scala:83)
[info]   at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
[info]   at org.scalatest.Transformer.apply(Transformer.scala:22)
[info]   at org.scalatest.Transformer.apply(Transformer.scala:20)
[info]   at org.scalatest.FunSuiteLike$$anon$1.apply(FunSuiteLike.scala:186)
[info]   at org.scalatest.TestSuite.withFixture(TestSuite.scala:196)
[info]   ...
[info] - relative resolves from custom working directory (602 milliseconds)
[info] CliGitDiffTests:
[info] - addition *** FAILED *** (2 seconds, 30 milliseconds)
[info]   ===========
[info]   => Obtained
[info]   ===========
[info]   Running DisableSyntax
[info]   C:\Users\xxxx\AppData\Local\Temp\scalafix5541531271482390748\new.scala:3:3: error: [DisableSyntax.keywords.var] var is disabled
[info]     var newVar = 1
[info]     ^
[info]
[info]
[info]   =======
[info]   => Diff
[info]   =======
[info]    Running DisableSyntax
[info]   -C:\Users\xxxx\AppData\Local\Temp\scalafix5541531271482390748\new.scala:3:3: error: [DisableSyntax.keywords.var] var is disabled
[info]   -  var newVar = 1
[info]   +C:\Users\xxxx\AppData\Local\Temp\scalafix5541531271482390748\new.scala:3:3: error: [DisableSyntax.keywords.var] var is disabled
[info]   +  var newVar = 1
[info]      ^ (CliGitDiffTests.scala:53)
[info] - modification *** FAILED *** (1 second, 496 milliseconds)
[info]   ===========
[info]   => Obtained
[info]   ===========
[info]   Running DisableSyntax
[info]   C:\Users\xxxx\AppData\Local\Temp\scalafix3659511271146098513\old.scala:7:3: error: [DisableSyntax.keywords.var] var is disabled
[info]     var newVar = 2
[info]     ^
[info]
[info]
[info]   =======
[info]   => Diff
[info]   =======
[info]    Running DisableSyntax
[info]   -C:\Users\xxxx\AppData\Local\Temp\scalafix3659511271146098513\old.scala:7:3: error: [DisableSyntax.keywords.var] var is disabled
[info]   -  var newVar = 2
[info]   +C:\Users\xxxx\AppData\Local\Temp\scalafix3659511271146098513\old.scala:7:3: error: [DisableSyntax.keywords.var] var is disabled
[info]   +  var newVar = 2
[info]      ^ (CliGitDiffTests.scala:94)
[info] - rename *** FAILED *** (890 milliseconds)
[info]   ===========
[info]   => Obtained
[info]   ===========
[info]   Running DisableSyntax
[info]   C:\Users\xxxx\AppData\Local\Temp\scalafix6507161690733786926\new.scala:5:3: error: [DisableSyntax.keywords.var] var is disabled
[info]     var newVar = 2
[info]     ^
[info]
[info]
[info]   =======
[info]   => Diff
[info]   =======
[info]    Running DisableSyntax
[info]   -C:\Users\xxxx\AppData\Local\Temp\scalafix6507161690733786926\new.scala:5:3: error: [DisableSyntax.keywords.var] var is disabled
[info]   -  var newVar = 2
[info]   +C:\Users\xxxx\AppData\Local\Temp\scalafix6507161690733786926\new.scala:5:3: error: [DisableSyntax.keywords.var] var is disabled
[info]   +  var newVar = 2
[info]      ^ (CliGitDiffTests.scala:136)
[info] - not a git repo (15 milliseconds)
[info] - custom base *** FAILED *** (523 milliseconds)
[info]   ===========
[info]   => Obtained
[info]   ===========
[info]   Running DisableSyntax
[info]   C:\Users\xxxx\AppData\Local\Temp\scalafix2568468899431638192\new.scala:5:3: error: [DisableSyntax.keywords.var] var is disabled
[info]     var newVar = 2
[info]     ^
[info]
[info]
[info]   =======
[info]   => Diff
[info]   =======
[info]    Running DisableSyntax
[info]   -C:\Users\xxxx\AppData\Local\Temp\scalafix2568468899431638192\new.scala:5:3: error: [DisableSyntax.keywords.var] var is disabled
[info]   -  var newVar = 2
[info]   +C:\Users\xxxx\AppData\Local\Temp\scalafix2568468899431638192\new.scala:5:3: error: [DisableSyntax.keywords.var] var is disabled
[info]   +  var newVar = 2
[info]      ^ (CliGitDiffTests.scala:194)
[info] - #483 unkown git hash (186 milliseconds)
[info] SymbolMatcherTest:
[info] - matches/unapply (16 milliseconds)
[info] - normalized (0 milliseconds)
[info] SemanticTests:
[info] - scala\test\explicitResultTypes\ExplicitResultTypesSingleton.scala (150 milliseconds)
[info] - scala\test\explicitResultTypes\ExplicitResultTypesBase.scala *** FAILED *** (254 milliseconds)
[info]   see above (SemanticRuleSuite.scala:120)
[info] - scala\test\escapeHatch\EscapeHatchPatches.scala (83 milliseconds)
[info] - scala\test\RemoveUnusedImports2.scala (16 milliseconds)
[info] - scala\sbtfix\Sbt1.scala (117 milliseconds)
[info] - scala\test\explicitResultTypes\ExplicitResultTypesShort.scala (26 milliseconds)
[info] - scala\test\NoFinalize.scala (158 milliseconds)
[info] - scala\test\DottyVolatileLazyVal.scala (0 milliseconds)
[info] - scala\test\explicitResultTypes\ExplicitResultTypesPathDependent.scala (53 milliseconds)
[info] - scala\test\DottyKeywords.scala (32 milliseconds)
[info] - scala\test\escapeHatch\EscapeHatchIntervals.scala (0 milliseconds)
[info] - scala\test\escapeHatch\EscapeHatchExpression.scala (16 milliseconds)
[info] - scala\test\RemoveXmlLiterals.scala (104 milliseconds)
[info] - scala\test\RemoveUnusedTerms.scala (10 milliseconds)
[info] - scala\test\DottyVarArgPattern.scala (24 milliseconds)
[info] - scala\test\FqnRule.scala (17 milliseconds)
[info] - scala\test\NoAutoTupling.scala (69 milliseconds)
[info] - scala\test\NoInferConfig.scala (6 milliseconds)
[info] - scala\test\escapeHatch\EscapeHatchDoubleOn.scala (11 milliseconds)
[info] - scala\test\escapeHatch\EscapeHatchUnused.scala (13 milliseconds)
[info] - scala\test\escapeHatch\EscapeHatchRange.scala (12 milliseconds)
[info] - scala\test\DisableUnless.scala (36 milliseconds)
[info] - scala\test\DisableSyntax.scala (60 milliseconds)
[info] - scala\test\escapeHatch\EscapeHatchEOF.scala (3 milliseconds)
[info] - scala\test\NoUnitInsertion.scala (14 milliseconds)
[info] - scala\test\escapeHatch\EscapeHatchWildcard.scala (10 milliseconds)
[info] - scala\test\RemoveUnusedImports.scala (89 milliseconds)
[info] - scala\test\ExplicitUnit.scala (18 milliseconds)
[info] - scala\test\NoInferDefaults.scala (16 milliseconds)
[info] - scala\test\escapeHatch\EscapeHatchMultipleRules.scala (6 milliseconds)
[info] - scala\test\PatchWithEmptyRange.scala (12 milliseconds)
[info] - scala\test\Disable.scala (20 milliseconds)
[info] - scala\test\LintAsserts.scala (6 milliseconds)
[info] - scala\test\NoValInForComprehension.scala (129 milliseconds)
[info] - scala\test\ReplaceSymbol.scala (34 milliseconds)
[info] - scala\test\ProcedureSyntax.scala (6 milliseconds)
[info] CliSemanticTests:
[info] - --classpath inference error *** FAILED *** (491 milliseconds)
[info]   "error: No files to fix! Missing at least one .scala or .sbt file from: C:\Users\xxxx\AppData\Local\Temp\scalafix1820410859984499025\input\scala\test\RemoveUnusedImports.scala
[info]   " did not contain "Unable to infer --classpath" (CliSemanticTests.scala:15)
[info] - --classpath explicit is OK *** FAILED *** (229 milliseconds)
[info]   InvalidCommandLineOption=8 did not equal Ok=0 (BaseCliTest.scala:117)
[info] - --sourceroot is not a file *** FAILED *** (375 milliseconds)
[info]   "error: No files to fix! Missing at least one .scala or .sbt file from: C:\Users\xxxx\AppData\Local\Temp\scalafix1155854082332642294\input\scala\test\RemoveUnusedImports.scala
[info]   " did not contain "Invalid --sourceroot" (CliSemanticTests.scala:37)
[info] - --sourceroot points to non-existing file *** FAILED *** (313 milliseconds)
[info]   "error: No files to fix! Missing at least one .scala or .sbt file from: C:\Users\xxxx\AppData\Local\Temp\scalafix2965063615375333836\input\scala\test\RemoveUnusedImports.scala
[info]   " did not contain "is not a file" (CliSemanticTests.scala:50)
[info] - --sourceroot does not resolve all --files *** FAILED *** (245 milliseconds)
[info]   "error: No files to fix! Missing at least one .scala or .sbt file from: C:\Users\xxxx\AppData\Local\Temp\scalafix3484397459270890247\input\scala\test\RemoveUnusedImports.scala
[info]   " did not contain "No semanticdb associated with" (CliSemanticTests.scala:70)
[info] ScalaTest
[info] Run completed in 6 seconds, 157 milliseconds.
[info] Total number of tests run: 122
[info] Suites: completed 19, aborted 0
[info] Tests: succeeded 109, failed 13, canceled 0, ignored 0, pending 0
[info] *** 13 TESTS FAILED ***
[error] Failed: Total 122, Failed 13, Errors 0, Passed 109
[error] Failed tests:
[error]         scalafix.tests.reflect.ScalafixReflectTests
[error]         scalafix.tests.cli.CliGitDiffTests
[error]         scalafix.tests.cli.CliSemanticTests
[error]         scalafix.tests.core.PatchSuite
[error]         scalafix.tests.rule.SemanticTests
[error]         scalafix.tests.reflect.ToolClasspathTests
[error] (unit/test:test) sbt.TestsFailedException: Tests unsuccessful
[error] Total time: 9 s, completed 6 janv. 2018 14:09:33

I'm running Windows 10 Pro with Scala 2.12.4 and SBT 1.1.0. Tests were ran in Intellij SBT shell.

@olafurpg
Copy link
Contributor

Superseded by #588

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants