File tree 3 files changed +24
-12
lines changed
engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument
lib/scala/testkit/src/main/scala/org/enso/testkit
3 files changed +24
-12
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import org.enso.polyglot.runtime.Runtime.Api.{
14
14
import org .enso .runtime .utils .ThreadUtils
15
15
import org .enso .text .{ContentVersion , Sha3_224VersionCalculator }
16
16
import org .enso .text .editing .model
17
- import org .enso .testkit .FlakySpec
17
+ import org .enso .testkit .{ DebugSpec , FlakySpec }
18
18
import org .graalvm .polyglot .Context
19
19
import org .scalatest .BeforeAndAfterEach
20
20
import org .scalatest .flatspec .AnyFlatSpec
@@ -30,6 +30,7 @@ class RuntimeAsyncCommandsTest
30
30
extends AnyFlatSpec
31
31
with Matchers
32
32
with BeforeAndAfterEach
33
+ with DebugSpec
33
34
with FlakySpec {
34
35
35
36
// === Test Utilities =======================================================
Original file line number Diff line number Diff line change
1
+ package org .enso .testkit
2
+
3
+ import org .enso .runtime .utils .ThreadUtils
4
+ import org .scalatest ._
5
+
6
+ /** Trait provides debug information when a test fails in the suite. */
7
+ trait DebugSpec extends TestSuite {
8
+
9
+ override def withFixture (test : NoArgTest ): Outcome = {
10
+ val result = super .withFixture(test)
11
+
12
+ if (result.isFailed || result.isCanceled) {
13
+ val msg = ThreadUtils .dumpAllStacktraces(
14
+ s " Thread dump of the failed test ` ${test.name}` "
15
+ )
16
+ println(msg)
17
+ }
18
+
19
+ result
20
+ }
21
+ }
Original file line number Diff line number Diff line change 1
1
package org .enso .testkit
2
2
3
- import org .enso .runtime .utils .ThreadUtils
4
3
import org .scalatest ._
5
4
6
5
/** Trait is used to mark the tests in the suite as _flaky_ and make them
@@ -21,16 +20,7 @@ trait FlakySpec extends TestSuite {
21
20
object SkipOnFailure extends Tag (" org.enso.test.skiponfailure" )
22
21
23
22
override def withFixture (test : NoArgTest ): Outcome = {
24
- val result = super .withFixture(test)
25
-
26
- if (result.isFailed || result.isCanceled) {
27
- val msg = ThreadUtils .dumpAllStacktraces(
28
- s " Thread dump of the failed flaky test ` ${test.name}` "
29
- )
30
- println(msg)
31
- }
32
-
33
- result match {
23
+ super .withFixture(test) match {
34
24
case Failed (_) | Canceled (_)
35
25
if Flaky .isEnabled && test.tags.contains(Flaky .name) =>
36
26
Pending
You can’t perform that action at this time.
0 commit comments