Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disables detekt due to missing dependencies #250

Merged
merged 4 commits into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ buildscript {
classpath "org.opensearch.gradle:build-tools:${opensearch_version}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}"
classpath "org.jetbrains.kotlin:kotlin-allopen:${kotlin_version}"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.0.0-RC15"
classpath "org.jacoco:org.jacoco.agent:0.8.5"
}
}
Expand All @@ -67,7 +66,6 @@ apply plugin: 'idea'
apply plugin: 'opensearch.opensearchplugin'
apply plugin: 'opensearch.testclusters'
apply plugin: 'opensearch.rest-test'
apply plugin: 'io.gitlab.arturbosch.detekt'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'org.jetbrains.kotlin.plugin.allopen'

Expand Down Expand Up @@ -134,11 +132,6 @@ task ktlintFormat(type: JavaExec, group: "formatting") {
args "-F", "src/**/*.kt"
}

detekt {
config = files("detekt.yml")
buildUponDefaultConfig = true
}

configurations.testCompile {
exclude module: "securemock"
}
Expand Down
12 changes: 0 additions & 12 deletions detekt.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Version 1.2.4.0 2022-01-18

Compatible with OpenSearch 1.2.4

### Infrastructure

* Disables detekt due to missing dependencies ([#250](https://github.com/opensearch-project/index-management/pull/250/files))
Original file line number Diff line number Diff line change
Expand Up @@ -89,38 +89,38 @@ class RestExplainRollupActionIT : RollupRestTestCase() {
@Throws(Exception::class)
fun `test explain rollup for nonexistent id`() {
// Creating a rollup so the config index exists
createRollup(rollup = randomRollup(), rollupId = "doesnt_exist_some_other_id")
createRollup(rollup = randomRollup(), rollupId = "doesnt_exist_some_other_rollup_id")
val response = client().makeRequest("GET", "$ROLLUP_JOBS_BASE_URI/doesnt_exist/_explain")
assertNull("Nonexistent rollup didn't return null", response.asMap()["doesnt_exist"])
}

@Throws(Exception::class)
fun `test explain rollup for wildcard id`() {
// Creating a rollup so the config index exists
createRollup(rollup = randomRollup(), rollupId = "wildcard_some_id")
createRollup(rollup = randomRollup(), rollupId = "wildcard_some_other_id")
createRollup(rollup = randomRollup(), rollupId = "wildcard_some_rollup_id")
createRollup(rollup = randomRollup(), rollupId = "wildcard_some_other_rollup_id")
val response = client().makeRequest("GET", "$ROLLUP_JOBS_BASE_URI/wildcard_some*/_explain")
// We don't expect there to always be metadata as we are creating random rollups and the job isn't running
// but we do expect the wildcard some* to expand to the two jobs created above and have non-null values (meaning they exist)
val map = response.asMap()
assertNotNull("Non null wildcard_some_id value wasn't in the response", map["wildcard_some_id"])
assertNotNull("Non null wildcard_some_other_id value wasn't in the response", map["wildcard_some_other_id"])
assertNotNull("Non null wildcard_some_rollup_id value wasn't in the response", map["wildcard_some_rollup_id"])
assertNotNull("Non null wildcard_some_other_rollup_id value wasn't in the response", map["wildcard_some_other_rollup_id"])
}

@Throws(Exception::class)
fun `test explain rollup for job that hasnt started`() {
createRollup(rollup = randomRollup().copy(metadataID = null), rollupId = "not_started_some_id")
val response = client().makeRequest("GET", "$ROLLUP_JOBS_BASE_URI/not_started_some_id/_explain")
val expectedMap = mapOf("not_started_some_id" to mapOf("metadata_id" to null, "rollup_metadata" to null))
createRollup(rollup = randomRollup().copy(metadataID = null), rollupId = "not_started_some_rollup_id")
val response = client().makeRequest("GET", "$ROLLUP_JOBS_BASE_URI/not_started_some_rollup_id/_explain")
val expectedMap = mapOf("not_started_some_rollup_id" to mapOf("metadata_id" to null, "rollup_metadata" to null))
assertEquals("The explain response did not match expected", expectedMap, response.asMap())
}

@Throws(Exception::class)
fun `test explain rollup for metadata_id but no metadata`() {
// This is to test the case of a rollup existing with a metadataID but there being no metadata document
createRollup(rollup = randomRollup().copy(metadataID = "some_metadata_id"), rollupId = "no_meta_some_id")
val response = client().makeRequest("GET", "$ROLLUP_JOBS_BASE_URI/no_meta_some_id/_explain")
val expectedMap = mapOf("no_meta_some_id" to mapOf("metadata_id" to "some_metadata_id", "rollup_metadata" to null))
createRollup(rollup = randomRollup().copy(metadataID = "some_metadata_id"), rollupId = "no_meta_some_rollup_id")
val response = client().makeRequest("GET", "$ROLLUP_JOBS_BASE_URI/no_meta_some_rollup_id/_explain")
val expectedMap = mapOf("no_meta_some_rollup_id" to mapOf("metadata_id" to "some_metadata_id", "rollup_metadata" to null))
assertEquals("The explain response did not match expected", expectedMap, response.asMap())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,37 +73,37 @@ class RestExplainTransformActionIT : TransformRestTestCase() {
@Throws(Exception::class)
fun `test explain transform for nonexistent id`() {
// Creating a transform so the config index exists
createTransform(transform = randomTransform(), transformId = "doesnt_exist_some_other_id")
createTransform(transform = randomTransform(), transformId = "doesnt_exist_some_other_transform_id")
val response = client().makeRequest("GET", "$TRANSFORM_BASE_URI/doesnt_exist/_explain")
assertNull("Nonexistent transform didn't return null", response.asMap()["doesnt_exist"])
}

@Throws(Exception::class)
fun `test explain transform for wildcard id`() {
// Creating a transform so the config index exists
createTransform(transform = randomTransform(), transformId = "wildcard_some_id")
createTransform(transform = randomTransform(), transformId = "wildcard_some_other_id")
createTransform(transform = randomTransform(), transformId = "wildcard_some_transform_id")
createTransform(transform = randomTransform(), transformId = "wildcard_some_other_transform_id")
val response = client().makeRequest("GET", "$TRANSFORM_BASE_URI/wildcard_some*/_explain")
// We don't expect there to always be metadata we are creating random transforms and the job isn't running
// but we do expect the wildcard some* to expand to the two jobs created above and have non-null values (meaning they exist)
val map = response.asMap()
assertNotNull("Non null wildcard_some_id value wasn't in the response", map["wildcard_some_id"])
assertNotNull("Non null wildcard_some_other_id value wasn't in the response", map["wildcard_some_other_id"])
assertNotNull("Non null wildcard_some_transform_id value wasn't in the response", map["wildcard_some_transform_id"])
assertNotNull("Non null wildcard_some_other_transform_id value wasn't in the response", map["wildcard_some_other_transform_id"])
}

@Throws(Exception::class)
fun `test explain transform for job that hasnt started`() {
createTransform(transform = randomTransform().copy(metadataId = null), transformId = "not_started_some_id")
val response = client().makeRequest("GET", "$TRANSFORM_BASE_URI/not_started_some_id/_explain")
val expectedMap = mapOf("not_started_some_id" to mapOf("metadata_id" to null, "transform_metadata" to null))
createTransform(transform = randomTransform().copy(metadataId = null), transformId = "not_started_some_transform_id")
val response = client().makeRequest("GET", "$TRANSFORM_BASE_URI/not_started_some_transform_id/_explain")
val expectedMap = mapOf("not_started_some_transform_id" to mapOf("metadata_id" to null, "transform_metadata" to null))
assertEquals("The explain response did not match expected", expectedMap, response.asMap())
}

@Throws(Exception::class)
fun `test explain transform for new transform attempted to create with metadata id`() {
createTransform(transform = randomTransform().copy(metadataId = "some_metadata_id"), transformId = "no_meta_some_id")
val response = client().makeRequest("GET", "$TRANSFORM_BASE_URI/no_meta_some_id/_explain")
val expectedMap = mapOf("no_meta_some_id" to mapOf("metadata_id" to null, "transform_metadata" to null))
createTransform(transform = randomTransform().copy(metadataId = "some_metadata_id"), transformId = "no_meta_some_transform_id")
val response = client().makeRequest("GET", "$TRANSFORM_BASE_URI/no_meta_some_transform_id/_explain")
val expectedMap = mapOf("no_meta_some_transform_id" to mapOf("metadata_id" to null, "transform_metadata" to null))
assertEquals("The explain response did not match expected", expectedMap, response.asMap())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class RestStartTransformActionIT : TransformRestTestCase() {
@Throws(Exception::class)
fun `test starting a failed transform`() {
val transform = randomTransform().copy(
id = "restart_failed_rollup",
id = "restart_failed_transform",
schemaVersion = 1L,
enabled = true,
jobSchedule = IntervalSchedule(Instant.now(), 1, ChronoUnit.MINUTES),
Expand Down Expand Up @@ -150,7 +150,7 @@ class RestStartTransformActionIT : TransformRestTestCase() {
generateNYCTaxiData("source_restart_finished_transform")
assertIndexExists("source_restart_finished_transform")
val transform = randomTransform().copy(
id = "restart_finished_rollup",
id = "restart_finished_transform",
schemaVersion = 1L,
enabled = true,
jobSchedule = IntervalSchedule(Instant.now(), 1, ChronoUnit.MINUTES),
Expand Down