Skip to content

Instantly share code, notes, and snippets.

@frgomes
Created April 10, 2022 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frgomes/c01e4854df97cdda2571e05139941ab0 to your computer and use it in GitHub Desktop.
Save frgomes/c01e4854df97cdda2571e05139941ab0 to your computer and use it in GitHub Desktop.
Spark - template for integration tests
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