From 072509363665c59c7df581edfd6b85fee6e98065 Mon Sep 17 00:00:00 2001 From: Paul Cleary Date: Tue, 29 Sep 2020 12:58:10 -0400 Subject: [PATCH] Skip CI for certain tests (#983) The `EmailNotifierIntegrationSpec` does not work in Github actions for some reason, likely due to sending an email. 1. Added a `SkipCI` tag that will enable us to by default skip certain tests in CI. 2. Updated the `build.sbt` to by default exclude `SkipCI` tests 3. Added `taggedAs(SkipCI)` to the email integration test --- build.sbt | 2 +- .../email/EmailNotifierIntegrationSpec.scala | 6 ++++-- .../src/test/scala/vinyldns/api/SkipCI.scala | 21 +++++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 modules/api/src/test/scala/vinyldns/api/SkipCI.scala diff --git a/build.sbt b/build.sbt index e53f4d55f..35d014948 100644 --- a/build.sbt +++ b/build.sbt @@ -47,7 +47,7 @@ lazy val testSettings = Seq( parallelExecution in Test := true, parallelExecution in IntegrationTest := false, fork in IntegrationTest := true, - testOptions in Test += Tests.Argument("-oDNCXEPQRMIK"), + testOptions in Test += Tests.Argument("-oDNCXEPQRMIK", "-l", "SkipCI"), logBuffered in Test := false, // Hide stack traces in tests traceLevel in Test := -1, diff --git a/modules/api/src/it/scala/vinyldns/api/notifier/email/EmailNotifierIntegrationSpec.scala b/modules/api/src/it/scala/vinyldns/api/notifier/email/EmailNotifierIntegrationSpec.scala index bcc1f8a7e..46567b09e 100644 --- a/modules/api/src/it/scala/vinyldns/api/notifier/email/EmailNotifierIntegrationSpec.scala +++ b/modules/api/src/it/scala/vinyldns/api/notifier/email/EmailNotifierIntegrationSpec.scala @@ -18,7 +18,7 @@ package vinyldns.api.notifier.email import com.typesafe.config.{Config, ConfigFactory} import vinyldns.core.notifier._ -import vinyldns.api.MySqlApiIntegrationSpec +import vinyldns.api.{MySqlApiIntegrationSpec, SkipCI} import vinyldns.mysql.MySqlIntegrationSpec import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpecLike @@ -28,7 +28,9 @@ import vinyldns.core.domain.record.AData import org.joda.time.DateTime import vinyldns.core.TestMembershipData._ import java.nio.file.{Files, Path, Paths} + import cats.effect.{IO, Resource} + import scala.collection.JavaConverters._ import org.scalatest.BeforeAndAfterEach import cats.implicits._ @@ -54,7 +56,7 @@ class EmailNotifierIntegrationSpec "Email Notifier" should { - "send an email" in { + "send an email" taggedAs (SkipCI) in { val batchChange = BatchChange( okUser.id, okUser.userName, diff --git a/modules/api/src/test/scala/vinyldns/api/SkipCI.scala b/modules/api/src/test/scala/vinyldns/api/SkipCI.scala new file mode 100644 index 000000000..9ff4e3bdd --- /dev/null +++ b/modules/api/src/test/scala/vinyldns/api/SkipCI.scala @@ -0,0 +1,21 @@ +/* + * Copyright 2018 Comcast Cable Communications Management, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package vinyldns.api + +import org.scalatest.Tag + +object SkipCI extends Tag("SkipCI")