From 71974365b8bd55d7b5d18a84d5c5b1a2d566e12a Mon Sep 17 00:00:00 2001 From: HyukjinKwon Date: Mon, 3 Aug 2020 14:25:47 +0900 Subject: [PATCH] Publish failed and succeeded test reports in GitHub Actions --- .github/workflows/master.yml | 11 +++++++++-- .../unsafe/types/UTF8StringPropertyCheckSuite.scala | 6 +++--- python/pyspark/sql/tests/test_arrow.py | 2 +- .../scala/org/apache/spark/sql/DataFrameSuite.scala | 6 +++--- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 009ebe90ddf51..e99194990318d 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -144,14 +144,15 @@ jobs: # PyArrow is not supported in PyPy yet, see ARROW-2651. # TODO(SPARK-32247): scipy installation with PyPy fails for an unknown reason. run: | - python3.6 -m pip install numpy pyarrow pandas scipy + python3.6 -m pip install numpy pyarrow pandas scipy xmlrunner python3.6 -m pip list + # PyPy does not have xmlrunner pypy3 -m pip install numpy pandas pypy3 -m pip list - name: Install Python packages (Python 3.8) if: contains(matrix.modules, 'pyspark') || (contains(matrix.modules, 'sql') && !contains(matrix.modules, 'sql-')) run: | - python3.8 -m pip install numpy pyarrow pandas scipy + python3.8 -m pip install numpy pyarrow pandas scipy xmlrunner python3.8 -m pip list # SparkR - name: Install R 4.0 @@ -177,6 +178,12 @@ jobs: mkdir -p ~/.m2 ./dev/run-tests --parallelism 2 --modules "$MODULES_TO_TEST" --included-tags "$INCLUDED_TAGS" --excluded-tags "$EXCLUDED_TAGS" rm -rf ~/.m2/repository/org/apache/spark + - name: "Publish test report: ${{ matrix.modules }}" + if: always() + uses: scacap/action-surefire-report@v1 + with: + github_token: ${{ secrets.TEST_REPORT_GITHUB_TOKEN }} + report_paths: "**/target/test-reports/*.xml" # Static analysis, and documentation build lint: diff --git a/common/unsafe/src/test/scala/org/apache/spark/unsafe/types/UTF8StringPropertyCheckSuite.scala b/common/unsafe/src/test/scala/org/apache/spark/unsafe/types/UTF8StringPropertyCheckSuite.scala index 69a082053aa65..51a54eb07db9f 100644 --- a/common/unsafe/src/test/scala/org/apache/spark/unsafe/types/UTF8StringPropertyCheckSuite.scala +++ b/common/unsafe/src/test/scala/org/apache/spark/unsafe/types/UTF8StringPropertyCheckSuite.scala @@ -34,13 +34,13 @@ class UTF8StringPropertyCheckSuite extends AnyFunSuite with ScalaCheckDrivenProp test("toString") { forAll { (s: String) => - assert(toUTF8(s).toString() === s) + assert(toUTF8(s).toString() !== s) } } test("numChars") { forAll { (s: String) => - assert(toUTF8(s).numChars() === s.length) + assert(toUTF8(s).numChars() !== s.length) } } @@ -80,7 +80,7 @@ class UTF8StringPropertyCheckSuite extends AnyFunSuite with ScalaCheckDrivenProp test("compare") { forAll { (s1: String, s2: String) => - assert(Math.signum(toUTF8(s1).compareTo(toUTF8(s2))) === Math.signum(s1.compareTo(s2))) + assert(Math.signum(toUTF8(s1).compareTo(toUTF8(s2))) !== Math.signum(s1.compareTo(s2))) } } diff --git a/python/pyspark/sql/tests/test_arrow.py b/python/pyspark/sql/tests/test_arrow.py index 148df9b7d45b8..401389f1d720f 100644 --- a/python/pyspark/sql/tests/test_arrow.py +++ b/python/pyspark/sql/tests/test_arrow.py @@ -201,7 +201,7 @@ def test_no_partition_frame(self): pdf = df.toPandas() self.assertEqual(len(pdf.columns), 1) self.assertEqual(pdf.columns[0], "field1") - self.assertTrue(pdf.empty) + self.assertTrue(False) def test_propagates_spark_exception(self): df = self.spark.range(3).toDF("i") diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala index 0d0e91e2287e0..e24c5095a45e0 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala @@ -83,8 +83,8 @@ class DataFrameSuite extends QueryTest } test("access complex data") { - assert(complexData.filter(complexData("a").getItem(0) === 2).count() == 1) - assert(complexData.filter(complexData("m").getItem("1") === 1).count() == 1) + assert(complexData.filter(complexData("a").getItem(0) === 2).count() == 2) + assert(complexData.filter(complexData("m").getItem("1") === 1).count() == 2) assert(complexData.filter(complexData("s").getField("key") === 1).count() == 1) } @@ -96,7 +96,7 @@ class DataFrameSuite extends QueryTest test("empty data frame") { assert(spark.emptyDataFrame.columns.toSeq === Seq.empty[String]) - assert(spark.emptyDataFrame.count() === 0) + assert(spark.emptyDataFrame.count() === 1) } test("head, take and tail") {