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

Run compile-test-snippets in a isolated job #2797

Merged

Conversation

cortinico
Copy link
Member

Similarly to what was done in #2796, I'm extracting a job for compile-test-snippets only. That's our biggest bottleneck at the moment.

This job (compile-test-snippets) will run in parallel with the others and should speedup the whole CI, given that we don't run detekt-cli on this job but just ./gradlew build -Pcompile-test-snippets=true.

Moreover, this should provide a better hint for contributors on what's the failure of their build (i.e. they don't need to know that we compile snippets only on ubuntu-latest + java8 to understand what failed).

@codecov
Copy link

codecov bot commented Jun 14, 2020

Codecov Report

Merging #2797 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2797      +/-   ##
============================================
+ Coverage     80.51%   80.53%   +0.01%     
- Complexity     2324     2326       +2     
============================================
  Files           386      386              
  Lines          6955     6957       +2     
  Branches       1262     1262              
============================================
+ Hits           5600     5603       +3     
  Misses          725      725              
+ Partials        630      629       -1     
Impacted Files Coverage Δ Complexity Δ
...gitlab/arturbosch/detekt/rules/style/MayBeConst.kt 80.00% <0.00%> (+2.91%) 42.00% <0.00%> (+2.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ca022b...d6d6aa7. Read the comment docs.

@BraisGabin
Copy link
Member

And as a opne question, should we use java 8 as the default version? Maybe we should use the last java version (14). I was the one that add the compilation in java8 the first time. My reasoning was that, in travis, ubuntu/java8 was the fastest build (and because I'm an Android developer and the newest Java version known by an Android dev is Java8 :P). Is java8 faster? It should not...

@arturbosch
Copy link
Member

And as a opne question, should we use java 8 as the default version? Maybe we should use the last java version (14). I was the one that add the compilation in java8 the first time. My reasoning was that, in travis, ubuntu/java8 was the fastest build (and because I'm an Android developer and the newest Java version known by an Android dev is Java8 :P). Is java8 faster? It should not...

I've seen some benchmarks where jdk13+ started to reach jdk8 performance. jdk9 had some regressions etc.
I'm okay with both jdk8 or 14.

@arturbosch arturbosch added this to the 1.10.0 milestone Jun 14, 2020
@arturbosch arturbosch added the housekeeping Marker for housekeeping tasks and refactorings label Jun 14, 2020
@cortinico
Copy link
Member Author

(and because I'm an Android developer and the newest Java version known by an Android dev is Java8 :P).

True story 😅
Let's udpate it to Java 14

@cortinico
Copy link
Member Author

cortinico commented Jun 14, 2020

Turns out that on Java 14 we have more failures. I suggest we bump the Java version for compile-test-snippets in a subsequent PR.

@BraisGabin
Copy link
Member

What? Does this task fail with Java 14? That's strange. But sure, we can merge this for now.

@cortinico
Copy link
Member Author

What? Does this task fail with Java 14? That's strange. But sure, we can merge this for now.

Yes, I was also able to reproduce the same failure on my local env. Here the log https://github.com/detekt/detekt/runs/770662663

Failing Tests
2020-06-14T21:35:09.3302867Z > Task :detekt-rules:test
2020-06-14T21:35:30.2301651Z 
2020-06-14T21:35:30.2380843Z LongParameterListSpec > does not report long parameter list for constructors if file is annotated with ignored annotation FAILED
2020-06-14T21:35:30.2381415Z     io.github.detekt.test.utils.KotlinScriptException: Given Kotlin code is invalid.
2020-06-14T21:35:30.2382182Z         at io.github.detekt.test.utils.KotlinScriptEngine.compile(KotlinScriptEngine.kt:21)
2020-06-14T21:35:30.2382652Z         at io.gitlab.arturbosch.detekt.test.RuleExtensionsKt.compileAndLint(RuleExtensions.kt:19)
2020-06-14T21:35:30.2383028Z         at io.gitlab.arturbosch.detekt.rules.complexity.LongParameterListSpec$1$1$11$1.invoke(LongParameterListSpec.kt:102)
2020-06-14T21:35:30.2386106Z         at io.gitlab.arturbosch.detekt.rules.complexity.LongParameterListSpec$1$1$11$1.invoke(LongParameterListSpec.kt:9)
2020-06-14T21:35:30.2386601Z 
2020-06-14T21:35:30.2387166Z         Caused by:
2020-06-14T21:35:30.2387845Z         javax.script.ScriptException: Error: error: unresolved reference: Generated
2020-06-14T21:35:30.2388219Z         @file:javax.annotation.Generated class Data(val a: Int)
2020-06-14T21:35:30.2388549Z                                ^
2020-06-14T21:35:30.2388892Z             at org.jetbrains.kotlin.cli.common.repl.KotlinJsr223JvmScriptEngineBase.compile(KotlinJsr223JvmScriptEngineBase.kt:74)
2020-06-14T21:35:30.2389707Z             at org.jetbrains.kotlin.cli.common.repl.KotlinJsr223JvmScriptEngineBase.compile(KotlinJsr223JvmScriptEngineBase.kt:35)
2020-06-14T21:35:30.2390076Z             at io.github.detekt.test.utils.KotlinScriptEngine.compile(KotlinScriptEngine.kt:18)
2020-06-14T21:35:30.2390403Z             ... 3 more
2020-06-14T21:35:30.2390648Z 
2020-06-14T21:35:30.2390985Z LongParameterListSpec > does not report long parameter list for functions if file is annotated with ignored annotation FAILED
2020-06-14T21:35:30.2391331Z     io.github.detekt.test.utils.KotlinScriptException: Given Kotlin code is invalid.
2020-06-14T21:35:30.2391688Z         at io.github.detekt.test.utils.KotlinScriptEngine.compile(KotlinScriptEngine.kt:21)
2020-06-14T21:35:30.2392027Z         at io.gitlab.arturbosch.detekt.test.RuleExtensionsKt.compileAndLint(RuleExtensions.kt:19)
2020-06-14T21:35:30.2392549Z         at io.gitlab.arturbosch.detekt.rules.complexity.LongParameterListSpec$1$1$11$2.invoke(LongParameterListSpec.kt:112)
2020-06-14T21:35:30.2392961Z         at io.gitlab.arturbosch.detekt.rules.complexity.LongParameterListSpec$1$1$11$2.invoke(LongParameterListSpec.kt:9)
2020-06-14T21:35:30.2393415Z 
2020-06-14T21:35:30.2393742Z         Caused by:
2020-06-14T21:35:30.2394494Z         javax.script.ScriptException: Error: error: unresolved reference: Generated
2020-06-14T21:35:30.2394868Z                             @file:javax.annotation.Generated 
2020-06-14T21:35:30.2395229Z                                                    ^
2020-06-14T21:35:30.2395940Z             at org.jetbrains.kotlin.cli.common.repl.KotlinJsr223JvmScriptEngineBase.compile(KotlinJsr223JvmScriptEngineBase.kt:74)
2020-06-14T21:35:30.2396365Z             at org.jetbrains.kotlin.cli.common.repl.KotlinJsr223JvmScriptEngineBase.compile(KotlinJsr223JvmScriptEngineBase.kt:35)
2020-06-14T21:35:30.2396750Z             at io.github.detekt.test.utils.KotlinScriptEngine.compile(KotlinScriptEngine.kt:18)
2020-06-14T21:35:30.2402151Z             ... 3 more
2020-06-14T21:35:30.2402558Z 
2020-06-14T21:35:30.2402990Z LongParameterListSpec > does not report long parameter list for constructors if class is annotated with ignored annotation FAILED
2020-06-14T21:35:30.2403429Z     io.github.detekt.test.utils.KotlinScriptException: Given Kotlin code is invalid.
2020-06-14T21:35:30.2403830Z         at io.github.detekt.test.utils.KotlinScriptEngine.compile(KotlinScriptEngine.kt:21)
2020-06-14T21:35:30.2404223Z         at io.gitlab.arturbosch.detekt.test.RuleExtensionsKt.compileAndLint(RuleExtensions.kt:19)
2020-06-14T21:35:30.2404733Z         at io.gitlab.arturbosch.detekt.rules.complexity.LongParameterListSpec$1$1$11$3.invoke(LongParameterListSpec.kt:117)
2020-06-14T21:35:30.2405160Z         at io.gitlab.arturbosch.detekt.rules.complexity.LongParameterListSpec$1$1$11$3.invoke(LongParameterListSpec.kt:9)
2020-06-14T21:35:30.2405484Z 
2020-06-14T21:35:30.2405844Z         Caused by:
2020-06-14T21:35:30.2406220Z         javax.script.ScriptException: Error: error: unresolved reference: Generated
2020-06-14T21:35:30.2406792Z         @javax.annotation.Generated class Data(val a: Int)
2020-06-14T21:35:30.2407246Z                           ^
2020-06-14T21:35:30.2407641Z             at org.jetbrains.kotlin.cli.common.repl.KotlinJsr223JvmScriptEngineBase.compile(KotlinJsr223JvmScriptEngineBase.kt:74)
2020-06-14T21:35:30.2408049Z             at org.jetbrains.kotlin.cli.common.repl.KotlinJsr223JvmScriptEngineBase.compile(KotlinJsr223JvmScriptEngineBase.kt:35)
2020-06-14T21:35:30.2408449Z             at io.github.detekt.test.utils.KotlinScriptEngine.compile(KotlinScriptEngine.kt:18)
2020-06-14T21:35:30.2408822Z             ... 3 more
2020-06-14T21:35:30.2409122Z 
2020-06-14T21:35:30.2409508Z LongParameterListSpec > does not report long parameter list for functions if class is annotated with ignored annotation FAILED
2020-06-14T21:35:30.2409909Z     io.github.detekt.test.utils.KotlinScriptException: Given Kotlin code is invalid.
2020-06-14T21:35:30.2410465Z         at io.github.detekt.test.utils.KotlinScriptEngine.compile(KotlinScriptEngine.kt:21)
2020-06-14T21:35:30.2410981Z         at io.gitlab.arturbosch.detekt.test.RuleExtensionsKt.compileAndLint(RuleExtensions.kt:19)
2020-06-14T21:35:30.2411437Z         at io.gitlab.arturbosch.detekt.rules.complexity.LongParameterListSpec$1$1$11$4.invoke(LongParameterListSpec.kt:126)
2020-06-14T21:35:30.2411850Z         at io.gitlab.arturbosch.detekt.rules.complexity.LongParameterListSpec$1$1$11$4.invoke(LongParameterListSpec.kt:9)
2020-06-14T21:35:30.2412183Z 
2020-06-14T21:35:30.2412534Z         Caused by:
2020-06-14T21:35:30.2412906Z         javax.script.ScriptException: Error: error: unresolved reference: Generated
2020-06-14T21:35:30.2413287Z                             @javax.annotation.Generated class Data { 
2020-06-14T21:35:30.2413663Z                                               ^
2020-06-14T21:35:30.2414051Z             at org.jetbrains.kotlin.cli.common.repl.KotlinJsr223JvmScriptEngineBase.compile(KotlinJsr223JvmScriptEngineBase.kt:74)
2020-06-14T21:35:30.2414476Z             at org.jetbrains.kotlin.cli.common.repl.KotlinJsr223JvmScriptEngineBase.compile(KotlinJsr223JvmScriptEngineBase.kt:35)
2020-06-14T21:35:30.2415550Z             at io.github.detekt.test.utils.KotlinScriptEngine.compile(KotlinScriptEngine.kt:18)
2020-06-14T21:35:30.2415936Z             ... 3 more
2020-06-14T21:39:18.3316030Z 
2020-06-14T21:39:18.3316946Z UnnecessaryAbstractClassSpec > does not report abstract classes with module annotation FAILED
2020-06-14T21:39:18.3317386Z     io.github.detekt.test.utils.KotlinScriptException: Given Kotlin code is invalid.
2020-06-14T21:39:18.3317807Z         at io.github.detekt.test.utils.KotlinScriptEngine.compile(KotlinScriptEngine.kt:21)
2020-06-14T21:39:18.3318218Z         at io.gitlab.arturbosch.detekt.test.RuleExtensionsKt.compileAndLintWithContext(RuleExtensions.kt:39)
2020-06-14T21:39:18.3318783Z         at io.gitlab.arturbosch.detekt.rules.style.UnnecessaryAbstractClassSpec$1$1$3$5.invoke(UnnecessaryAbstractClassSpec.kt:192)
2020-06-14T21:39:18.3319252Z         at io.gitlab.arturbosch.detekt.rules.style.UnnecessaryAbstractClassSpec$1$1$3$5.invoke(UnnecessaryAbstractClassSpec.kt:12)
2020-06-14T21:39:18.3319548Z 
2020-06-14T21:39:18.3319883Z         Caused by:
2020-06-14T21:39:18.3321448Z         javax.script.ScriptException: Error: error: symbol is declared in module 'jdk.scripting.nashorn' which does not export package 'jdk.nashorn.internal.ir.annotations'
2020-06-14T21:39:18.3321941Z                             import jdk.nashorn.internal.ir.annotations.Ignore
2020-06-14T21:39:18.3322471Z                                                                        ^
2020-06-14T21:39:18.3323164Z         error: symbol is declared in module 'jdk.scripting.nashorn' which does not export package 'jdk.nashorn.internal.ir.annotations'
2020-06-14T21:39:18.3323583Z                             @Ignore
2020-06-14T21:39:18.3323925Z                              ^
2020-06-14T21:39:18.3324992Z         error: symbol is declared in module 'jdk.scripting.nashorn' which does not export package 'jdk.nashorn.internal.ir.annotations'
2020-06-14T21:39:18.3355893Z                             @jdk.nashorn.internal.ir.annotations.Ignore
2020-06-14T21:39:18.3356380Z                                                                  ^
2020-06-14T21:39:18.3356763Z             at org.jetbrains.kotlin.cli.common.repl.KotlinJsr223JvmScriptEngineBase.compile(KotlinJsr223JvmScriptEngineBase.kt:74)
2020-06-14T21:39:18.3357157Z             at org.jetbrains.kotlin.cli.common.repl.KotlinJsr223JvmScriptEngineBase.compile(KotlinJsr223JvmScriptEngineBase.kt:35)
2020-06-14T21:39:18.3357515Z             at io.github.detekt.test.utils.KotlinScriptEngine.compile(KotlinScriptEngine.kt:18)
2020-06-14T21:39:18.3357856Z             ... 3 more
2020-06-14T21:44:00.2302321Z 
2020-06-14T21:44:00.2303210Z 1436 tests completed, 5 failed
2020-06-14T21:44:00.3305036Z 
2020-06-14T21:44:00.3306823Z > Task :detekt-rules:test FAILED

@BraisGabin
Copy link
Member

BraisGabin commented Jun 15, 2020

Oh, I saw this issue before: google/dagger#1449

We should change that annotation. But that could be done in other PR.

@BraisGabin BraisGabin merged commit 6a2fc95 into detekt:master Jun 15, 2020
@cortinico cortinico deleted the nc/actions-compiletestsnippets-parallel branch June 15, 2020 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Marker for housekeeping tasks and refactorings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants