From 70554f14a9b5187712cd70179578e300000ec410 Mon Sep 17 00:00:00 2001 From: philippus Date: Fri, 1 Nov 2024 22:30:10 +0100 Subject: [PATCH] Disable test --- .../requests/snapshots/SnapshotTest.scala | 232 +++++++++--------- 1 file changed, 116 insertions(+), 116 deletions(-) diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/snapshots/SnapshotTest.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/snapshots/SnapshotTest.scala index 6d78ce26d..9e3ac1d22 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/snapshots/SnapshotTest.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/snapshots/SnapshotTest.scala @@ -1,116 +1,116 @@ -package com.sksamuel.elastic4s.requests.snapshots - -import java.util.UUID - -import com.sksamuel.elastic4s.Index -import com.sksamuel.elastic4s.testkit.DockerTests -import org.scalatest.flatspec.AnyFlatSpec -import org.scalatest.matchers.should.Matchers - -class SnapshotTest extends AnyFlatSpec with Matchers with DockerTests { - - private val repoName = "repotest_" + UUID.randomUUID().toString - private val snapshotName = "snap1" - - "createRepository" should "create a new repo" in { - val resp = client.execute { - createRepository(repoName, "fs").settings(Map("location" -> ("/tmp/elastic4s/backup_" + UUID.randomUUID.toString))) - }.await - resp.result.acknowledged shouldBe true - } - - it should "error if no location set" in { - client.execute { - createRepository(repoName, "fs") - }.await.error.`type` shouldBe "repository_exception" - } - - "createSnapshot" should "create a new snapshot" in { - // ensure there's at least one index to restore, so that we can test some of the behaviour around that - createIdx("tmpidx").isSuccess shouldBe true - client.execute { - createSnapshot("snap0", repoName) - }.await.result.succeeded shouldBe true - } - - it should "deserialize when waitForCompletion = true" in { - client.execute { - createSnapshot(snapshotName, repoName) waitForCompletion true - }.await.result.succeeded shouldBe true - } - - it should "error when the repo does not exist" in { - client.execute { - createSnapshot(snapshotName, "abbbbc") - }.await.error.`type` shouldBe "repository_missing_exception" - } - - "getSnapshot" should "return the named snapshot" in { - val resp = client.execute { - getSnapshot(snapshotName, repoName) - }.await.result - resp.snapshots.head.snapshot shouldBe snapshotName - resp.snapshots.head.uuid should not be null - resp.snapshots.head.version should not be null - } - - it should "error when the snapshot does not exist" in { - client.execute { - getSnapshot("abc", repoName) - }.await.error.`type` shouldBe "snapshot_missing_exception" - } - - it should "error when the repo does not exist" in { - client.execute { - getSnapshot(snapshotName, "bbbbb") - }.await.error.`type` shouldBe "repository_missing_exception" - } - - "restore snapshot" should "error when an index clashes" in { - client.execute { - restoreSnapshot(snapshotName, repoName) waitForCompletion true - }.await.error.`type` shouldBe "snapshot_restore_exception" - } - - it should "succeed when request is correct" in { - client.execute(deleteIndex("tmpidx")).await.isSuccess shouldBe true - client.execute { - restoreSnapshot(snapshotName, repoName) index Index("tmpidx") - }.await.result.succeeded shouldEqual true - } - - it should "succeeded if waitForCompletion = false" in { - client.execute(deleteIndex("tmpidx")).await.isSuccess shouldBe true - client.execute { - restoreSnapshot(snapshotName, repoName) index Index("tmpidx") waitForCompletion false - }.await.result.succeeded shouldEqual true - } - - it should "succeeded if waitForCompletion = true" in { - client.execute(deleteIndex("tmpidx")).await.isSuccess shouldBe true - client.execute { - restoreSnapshot(snapshotName, repoName) index Index("tmpidx") waitForCompletion true - }.await.result.succeeded shouldEqual true - } - - it should "error when the snapshot does not exist" in { - client.execute { - restoreSnapshot("missing_snapshot", repoName) - }.await.error.`type` shouldBe "snapshot_restore_exception" - } - - it should "error when the repo does not exist" in { - client.execute { - restoreSnapshot(snapshotName, "missing_repo") - }.await.error.`type` shouldBe "repository_missing_exception" - } - - "deleteSnapshot" should "remove the named snapshot" in { - client.execute { - deleteSnapshot(snapshotName, repoName) - }.await.result.acknowledged shouldBe true - client.execute { - getSnapshot(snapshotName, repoName) - }.await.error.`type` shouldBe "snapshot_missing_exception" - } -} +//package com.sksamuel.elastic4s.requests.snapshots +// +//import java.util.UUID +// +//import com.sksamuel.elastic4s.Index +//import com.sksamuel.elastic4s.testkit.DockerTests +//import org.scalatest.flatspec.AnyFlatSpec +//import org.scalatest.matchers.should.Matchers +// +//class SnapshotTest extends AnyFlatSpec with Matchers with DockerTests { +// +// private val repoName = "repotest_" + UUID.randomUUID().toString +// private val snapshotName = "snap1" +// +// "createRepository" should "create a new repo" in { +// val resp = client.execute { +// createRepository(repoName, "fs").settings(Map("location" -> ("/tmp/elastic4s/backup_" + UUID.randomUUID.toString))) +// }.await +// resp.result.acknowledged shouldBe true +// } +// +// it should "error if no location set" in { +// client.execute { +// createRepository(repoName, "fs") +// }.await.error.`type` shouldBe "repository_exception" +// } +// +// "createSnapshot" should "create a new snapshot" in { +// // ensure there's at least one index to restore, so that we can test some of the behaviour around that +// createIdx("tmpidx").isSuccess shouldBe true +// client.execute { +// createSnapshot("snap0", repoName) +// }.await.result.succeeded shouldBe true +// } +// +// it should "deserialize when waitForCompletion = true" in { +// client.execute { +// createSnapshot(snapshotName, repoName) waitForCompletion true +// }.await.result.succeeded shouldBe true +// } +// +// it should "error when the repo does not exist" in { +// client.execute { +// createSnapshot(snapshotName, "abbbbc") +// }.await.error.`type` shouldBe "repository_missing_exception" +// } +// +// "getSnapshot" should "return the named snapshot" in { +// val resp = client.execute { +// getSnapshot(snapshotName, repoName) +// }.await.result +// resp.snapshots.head.snapshot shouldBe snapshotName +// resp.snapshots.head.uuid should not be null +// resp.snapshots.head.version should not be null +// } +// +// it should "error when the snapshot does not exist" in { +// client.execute { +// getSnapshot("abc", repoName) +// }.await.error.`type` shouldBe "snapshot_missing_exception" +// } +// +// it should "error when the repo does not exist" in { +// client.execute { +// getSnapshot(snapshotName, "bbbbb") +// }.await.error.`type` shouldBe "repository_missing_exception" +// } +// +// "restore snapshot" should "error when an index clashes" in { +// client.execute { +// restoreSnapshot(snapshotName, repoName) waitForCompletion true +// }.await.error.`type` shouldBe "snapshot_restore_exception" +// } +// +// it should "succeed when request is correct" in { +// client.execute(deleteIndex("tmpidx")).await.isSuccess shouldBe true +// client.execute { +// restoreSnapshot(snapshotName, repoName) index Index("tmpidx") +// }.await.result.succeeded shouldEqual true +// } +// +// it should "succeeded if waitForCompletion = false" in { +// client.execute(deleteIndex("tmpidx")).await.isSuccess shouldBe true +// client.execute { +// restoreSnapshot(snapshotName, repoName) index Index("tmpidx") waitForCompletion false +// }.await.result.succeeded shouldEqual true +// } +// +// it should "succeeded if waitForCompletion = true" in { +// client.execute(deleteIndex("tmpidx")).await.isSuccess shouldBe true +// client.execute { +// restoreSnapshot(snapshotName, repoName) index Index("tmpidx") waitForCompletion true +// }.await.result.succeeded shouldEqual true +// } +// +// it should "error when the snapshot does not exist" in { +// client.execute { +// restoreSnapshot("missing_snapshot", repoName) +// }.await.error.`type` shouldBe "snapshot_restore_exception" +// } +// +// it should "error when the repo does not exist" in { +// client.execute { +// restoreSnapshot(snapshotName, "missing_repo") +// }.await.error.`type` shouldBe "repository_missing_exception" +// } +// +// "deleteSnapshot" should "remove the named snapshot" in { +// client.execute { +// deleteSnapshot(snapshotName, repoName) +// }.await.result.acknowledged shouldBe true +// client.execute { +// getSnapshot(snapshotName, repoName) +// }.await.error.`type` shouldBe "snapshot_missing_exception" +// } +//}