Skip to content

Commit dd647f3

Browse files
authored
Fix CI compile checks (#3481)
* Fix failing unit tests
1 parent 6a99917 commit dd647f3

File tree

4 files changed

+10
-29
lines changed

4 files changed

+10
-29
lines changed

.github/workflows/build-and-test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ jobs:
111111
- name: Run unit tests (retry)
112112
id: test-retry
113113
if: steps.test.outcome=='failure'
114-
continue-on-error: true
115114
run: |
116115
set -o pipefail
117116
RESUME_FROM="$({ grep --text 'mvn <args> -rf ' test.log || test $? = 1; } | tail -n1 | sed 's/.*-rf/-rf/')"

geomesa-convert/geomesa-convert-common/src/test/scala/org/locationtech/geomesa/convert2/transforms/ExpressionTest.scala

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import org.locationtech.geomesa.convert.EvaluationContext
1515
import org.locationtech.geomesa.convert.EvaluationContext.{StatefulEvaluationContext, Stats}
1616
import org.locationtech.geomesa.convert2.AbstractConverter.BasicField
1717
import org.locationtech.geomesa.convert2.Field
18-
import org.locationtech.geomesa.convert2.metrics.ConverterMetrics
1918
import org.locationtech.geomesa.convert2.transforms.Expression.{FunctionExpression, Literal}
2019
import org.locationtech.geomesa.utils.text.WKTUtils
2120
import org.locationtech.jts.geom._
@@ -946,12 +945,15 @@ class ExpressionTest extends Specification {
946945
}
947946
}
948947
"convert integer to boolean" >> {
949-
val trans = Expression("intToBoolean($0)")
950-
trans.apply(Array(Int.box(1))) mustEqual true
951-
trans.apply(Array(Int.box(0))) mustEqual false
952-
trans.apply(Array(Int.box(-20))) mustEqual true
953-
trans.apply(Array(Int.box(10000))) mustEqual true
954-
trans.apply(Array(Double.box(2.2))) must throwA[ClassCastException]
948+
foreach(Seq("intToBoolean", "toBoolean")) { expr =>
949+
val trans = Expression(expr + "($0)")
950+
trans.apply(Array(Int.box(1))) mustEqual true
951+
trans.apply(Array(Int.box(0))) mustEqual false
952+
trans.apply(Array(Int.box(-20))) mustEqual true
953+
trans.apply(Array(Int.box(10000))) mustEqual true
954+
trans.apply(Array(null)) must beNull
955+
trans.apply(Array(Double.box(2.2))) mustEqual true
956+
}
955957
}
956958
"strip quotes" >> {
957959
val trans = Expression("stripQuotes($0)")

geomesa-convert/geomesa-convert-common/src/test/scala/org/locationtech/geomesa/convert2/transforms/MiscFunctionFactoryTest.scala

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,6 @@ import org.specs2.runner.JUnitRunner
1616
class MiscFunctionFactoryTest extends Specification {
1717

1818
"MiscFunctionFactory" >> {
19-
"intToBoolean" should {
20-
"convert a 0 to false" >> {
21-
MiscFunctionFactory.intToBoolean(Array(Int.box(0))) mustEqual false
22-
}
23-
"convert a 1 to true" >> {
24-
MiscFunctionFactory.intToBoolean(Array(Int.box(1))) mustEqual true
25-
}
26-
"convert any int other than 0 to true" >> {
27-
MiscFunctionFactory.intToBoolean(Array(Int.box(1000))) mustEqual true
28-
MiscFunctionFactory.intToBoolean(Array(Int.box(-2))) mustEqual true
29-
}
30-
"return null for null input" >> {
31-
MiscFunctionFactory.intToBoolean(Array(null)) mustEqual null
32-
}
33-
"throw an error if faced with a non-int value" >> {
34-
MiscFunctionFactory.intToBoolean(Array(Double.box(0.55567))) must throwA[ClassCastException]
35-
MiscFunctionFactory.intToBoolean(Array("0")) must throwA[ClassCastException]
36-
}
37-
}
38-
3919
"require" should {
4020
"return the passed-in argument, if it exists" >> {
4121
MiscFunctionFactory.require(Array("a")) mustEqual "a"

geomesa-features/geomesa-feature-avro/src/test/scala/org/locationtech/geomesa/features/avro/serde/Version1BackwardsCompatTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class Version1BackwardsCompatTest extends Specification {
110110
}
111111

112112
def readPipeFile(f: File, sft: SimpleFeatureType): List[ScalaSimpleFeature] =
113-
WithClose(Source.fromFile(f)(UTF8))(_.getLines).map(line => ScalaSimpleFeature.copy(DataUtilities.createFeature(sft, line))).toList
113+
WithClose(Source.fromFile(f)(UTF8))(_.getLines.toList).map(line => ScalaSimpleFeature.copy(DataUtilities.createFeature(sft, line)))
114114

115115
def createComplicatedFeatures(numFeatures : Int): Seq[Version1ASF] = {
116116
val geoSchema = "f0:String,f1:Integer,f2:Double,f3:Float,f4:Boolean,f5:UUID,f6:Date,f7:Point:srid=4326,f8:Polygon:srid=4326"

0 commit comments

Comments
 (0)