Skip to content

Commit 6c67050

Browse files
committed
ignore notebook tests if they fail because of issue #1116
1 parent 973b521 commit 6c67050

File tree

2 files changed

+20
-5
lines changed
  • core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/statistics
  • dataframe-jupyter/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter

2 files changed

+20
-5
lines changed

core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/statistics/sum.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.jetbrains.kotlinx.dataframe.statistics
22

33
import io.kotest.assertions.throwables.shouldThrow
4-
import io.kotest.matchers.booleans.shouldBeTrue
54
import io.kotest.matchers.doubles.shouldBeNaN
65
import io.kotest.matchers.floats.shouldBeNaN
76
import io.kotest.matchers.shouldBe

dataframe-jupyter/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/SampleNotebooksTests.kt

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package org.jetbrains.kotlinx.dataframe.jupyter
33
import org.jetbrains.jupyter.parser.JupyterParser
44
import org.jetbrains.jupyter.parser.notebook.CodeCell
55
import org.jetbrains.jupyter.parser.notebook.Output
6-
import org.jetbrains.kotlinx.dataframe.BuildConfig
7-
import org.junit.Assume
8-
import org.junit.Before
6+
import org.jetbrains.kotlinx.jupyter.exceptions.causesSequence
7+
import org.jetbrains.kotlinx.jupyter.repl.result.EvalResultEx
8+
import org.junit.AssumptionViolatedException
99
import org.junit.Test
1010
import java.io.File
1111
import java.util.Locale
@@ -120,9 +120,25 @@ class SampleNotebooksTests : DataFrameJupyterTest() {
120120
val codeToExecute = replacer.replace(code)
121121

122122
// println("Executing code:\n$codeToExecute")
123-
val cellResult = execRendered(codeToExecute)
123+
val cellResult = execEx(codeToExecute)
124+
if (cellResult is EvalResultEx.AbstractError) {
125+
throw cellResult.error
126+
}
127+
require(cellResult is EvalResultEx.Success)
128+
124129
// println(cellResult)
125130
}
131+
} catch (e: Exception) {
132+
if (e.causesSequence()
133+
.filterIsInstance<IllegalStateException>()
134+
.any { it.message?.contains("null DefinitelyNotNullType for") == true }
135+
) {
136+
// Issue #1116: https://github.com/Kotlin/dataframe/issues/1116
137+
// Cannot finish test until this is solved, so treat this test as "ignored"
138+
throw AssumptionViolatedException("Test skipped due to issue #1116")
139+
} else {
140+
throw e
141+
}
126142
} finally {
127143
cleanup()
128144
}

0 commit comments

Comments
 (0)