Skip to content

Commit

Permalink
Cleanup test output and enable tests that are now passing.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkvangorder committed Apr 27, 2022
1 parent 742c91c commit e891977
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import okio.ByteString.Companion.encode
import org.assertj.core.api.Assertions.assertThat
import org.intellij.lang.annotations.Language
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.openrewrite.InMemoryExecutionContext
import org.openrewrite.Issue
Expand Down Expand Up @@ -1011,7 +1010,6 @@ class MavenParserTest {
}

@Issue("https://github.com/openrewrite/rewrite/issues/376")
@Disabled
@Test
fun dependencyManagementPropagatesToDependencies() {
// a depends on b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class MavenSettingsTest {
assertThat(ctx.repositories).hasSize(1)
}

@Disabled
@Issue("https://github.com/openrewrite/rewrite/issues/131")
@Test
fun defaultActiveWhenNoOthersAreActive() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ class UpgradePluginVersionTest : MavenRecipeTest {
)

@Test
@Disabled("not currently dealing with parents") // todo
fun upgradeVersionIgnoringParent(@TempDir tempDir: Path) {
val parent = tempDir.resolve("pom.xml")
val server = tempDir.resolve("server/pom.xml")
Expand Down Expand Up @@ -312,7 +311,7 @@ class UpgradePluginVersionTest : MavenRecipeTest {
}

@Test
@Disabled("not currently dealing with parents") // todo
@Disabled
fun trustParent(@TempDir tempDir: Path) {
val parent = tempDir.resolve("pom.xml")
val server = tempDir.resolve("server/pom.xml")
Expand Down Expand Up @@ -410,7 +409,7 @@ class UpgradePluginVersionTest : MavenRecipeTest {
}

@Test
@Disabled("not currently dealing with parents") // todo
@Disabled
fun upgradePluginInParent(@TempDir tempDir: Path) {
val parent = tempDir.resolve("pom.xml")
val server = tempDir.resolve("server/pom.xml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,16 @@
*/
package org.openrewrite.maven

import io.micrometer.core.instrument.Metrics
import io.micrometer.core.instrument.config.MeterFilter
import org.intellij.lang.annotations.Language
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.BeforeAll
import org.openrewrite.ExecutionContext
import org.openrewrite.Recipe
import org.openrewrite.RecipeTest
import org.openrewrite.internal.LoggingMeterRegistry
import org.openrewrite.xml.tree.Xml
import java.io.File
import java.nio.file.Path

@Suppress("unused")
interface MavenRecipeTest : RecipeTest<Xml.Document> {
companion object {
private val meterRegistry = LoggingMeterRegistry.builder().build()

@BeforeAll
@JvmStatic
fun setMeterRegistry() {
meterRegistry.config()
.meterFilter(MeterFilter.acceptNameStartsWith("rewrite.maven"))
.meterFilter(MeterFilter.deny())
.meterFilter(MeterFilter.ignoreTags("group.id", "artifact.id"))
Metrics.globalRegistry.add(meterRegistry)
}

@AfterAll
@JvmStatic
fun unsetMeterRegistry() {
Metrics.globalRegistry.remove(meterRegistry)
}
}

@AfterEach
fun printMetrics() {
meterRegistry.print()
}

override val parser: MavenParser
get() = MavenParser.builder().build()
Expand Down

0 comments on commit e891977

Please sign in to comment.