Skip to content

Commit

Permalink
Add AD tests
Browse files Browse the repository at this point in the history
 On branch main
 Your branch is up to date with 'origin/main'.

 Changes to be committed:
	modified:   tsumugi-server/src/test/scala/com/ssinchenko/DeequSuiteBuilderTest.scala
  • Loading branch information
SemyonSinchenko committed Aug 18, 2024
1 parent 57df925 commit de47bd1
Showing 1 changed file with 38 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,21 +125,21 @@ class DeequSuiteBuilderTest extends AnyFunSuiteLike with BeforeAndAfterAll {
)
.build()
)
val size =
DeequSuiteBuilder.parseAnalyzer(proto.Analyzer.newBuilder().setSize(proto.Size.newBuilder().build()).build())
val sum = DeequSuiteBuilder.parseAnalyzer(
val maxLength = DeequSuiteBuilder.parseAnalyzer(
proto.Analyzer
.newBuilder()
.setSum(
proto.Sum.newBuilder().setColumn("numViews").build()
.setMaxLength(
proto.MaxLength.newBuilder().setColumn("description").build()
)
.build()
)
val maxLength = DeequSuiteBuilder.parseAnalyzer(
val size =
DeequSuiteBuilder.parseAnalyzer(proto.Analyzer.newBuilder().setSize(proto.Size.newBuilder().build()).build())
val sum = DeequSuiteBuilder.parseAnalyzer(
proto.Analyzer
.newBuilder()
.setMaxLength(
proto.MaxLength.newBuilder().setColumn("description").build()
.setSum(
proto.Sum.newBuilder().setColumn("numViews").build()
)
.build()
)
Expand Down Expand Up @@ -221,6 +221,36 @@ class DeequSuiteBuilderTest extends AnyFunSuiteLike with BeforeAndAfterAll {
.setDoubleExpectation(1.0)
)
)
protoSuiteBuilder.setFileSystemRepository(
proto.VerificationSuite.FileSystemRepository
.newBuilder().setPath("test-file.json")
)
protoSuiteBuilder.addAnomalyDetections(
proto.AnomalyDetection
.newBuilder()
.setAnalyzer(
proto.Analyzer.newBuilder().setSize(proto.Size.newBuilder().build())
)
.setAnomalyDetectionStrategy(
proto.AnomalyDetectionStrategy
.newBuilder()
.setRelativeRateOfChangeStrategy(
proto.RelativeRateOfChangeStrategy
.newBuilder()
.setMaxRateIncrease(1.2)
.setMaxRateDecrease(0.8)
.setOrder(1)
)
)
.setConfig(
proto.AnomalyDetection.AnomalyCheckConfig
.newBuilder()
.setLevel(proto.CheckLevel.Warning)
.setDescription("My best description")
.setBeforeDate(1000)
.setAfterDate(0)
)
)

val deequSuite = DeequSuiteBuilder.protoToVerificationSuite(data, protoSuiteBuilder.build())
val checkResults = deequSuite.run().checkResults
Expand Down

0 comments on commit de47bd1

Please sign in to comment.