Created
April 10, 2022 21:50
-
-
Save frgomes/c01e4854df97cdda2571e05139941ab0 to your computer and use it in GitHub Desktop.
Spark - template for integration tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example | |
import utest._ | |
object SparkExampleTests extends TestSuite { | |
import scala.util.{Try,Success,Failure} | |
import org.apache.spark.sql.SparkSession | |
val _spark: Try[SparkSession] = | |
Try { | |
implicit val spark: SparkSession = SparkSession.builder() | |
.master("local[*]") | |
.appName("SparkExampleTests") | |
.getOrCreate() | |
spark | |
} | |
override def utestAfterAll(): Unit = { | |
_spark.foreach(spark => spark.close) | |
} | |
val tests: Tests = Tests { | |
test("ability to read input files from src/main/resources") { | |
assert(true) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment