Skip to content

Commit

Permalink
Ignore a few silently failing tests for SQL Server (#1864)
Browse files Browse the repository at this point in the history
- They all do reference loops
- They don't work currently
- All will work when we can do custom `onDelete` and `onUpdate` rules
  • Loading branch information
Julius de Bruijn committed May 10, 2021
1 parent 5652579 commit 96f8076
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package queries.filters

import org.scalatest.{FlatSpec, Matchers}
import util.{ApiSpecBase, ProjectDsl}
import util.{ApiSpecBase, IgnoreMsSql, ProjectDsl}

class OneToOneSelfRelationRegressionSpec extends FlatSpec with Matchers with ApiSpecBase {
"Querying a 1:1 self relation with nulls" should "work on both sides" in {
// Bring back sql server when cascading rules can be set!
"Querying a 1:1 self relation with nulls" should "work on both sides" taggedAs IgnoreMsSql in {
val project = ProjectDsl.fromString {
s"""
|model User {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import util._
class SelfRelationFilterSpec extends FlatSpec with Matchers with ApiSpecBase {
override def runOnlyForCapabilities = Set(JoinRelationLinksCapability)

// Take this out when cascading rules can be set.
override def doNotRunForConnectors: Set[ConnectorTag] = Set(ConnectorTag.MsSqlConnectorTag)

val project = ProjectDsl.fromString {
connectorTag match {
case _: RelationalConnectorTag =>
Expand Down Expand Up @@ -71,6 +74,7 @@ class SelfRelationFilterSpec extends FlatSpec with Matchers with ApiSpecBase {
setupRockRelations
}

// Bring back sql server when cascading rules can be set!
"Filter Queries along self relations" should "succeed with one level " taggedAs (IgnoreMsSql) in {
val filterKurt =
s"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class OrderByDependentModelSpec extends FlatSpec with Matchers with ApiSpecBase
"""
}

// Take this out when cascading rules can be set.
override def doNotRunForConnectors: Set[ConnectorTag] = Set(ConnectorTag.MsSqlConnectorTag)

override protected def beforeEach(): Unit = {
super.beforeEach()
database.setup(project)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import org.scalatest.{FlatSpec, Matchers}
import util._

class OrderByDependentPaginationModelSpec extends FlatSpec with Matchers with ApiSpecBase {
// Take this out when cascading rules can be set.
override def doNotRunForConnectors: Set[ConnectorTag] = Set(ConnectorTag.MsSqlConnectorTag)

implicit val project: Project = SchemaDsl.fromStringV11() {
"""
|model ModelA {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ class Prisma_3078Spec extends FlatSpec with Matchers with ApiSpecBase with Schem
}
}

"A relation filter on a 1:M self relation " should "work" in {
// Bring back sql server when cascading rules can be set!
"A relation filter on a 1:M self relation " should "work" taggedAs (IgnoreMsSql) in {
for (fieldName <- Vector("field_a", "field_z")) {
val project = ProjectDsl.fromString {
s"""
Expand Down Expand Up @@ -174,7 +175,8 @@ class Prisma_3078Spec extends FlatSpec with Matchers with ApiSpecBase with Schem
}
}

"A relation filter on a N:M self relation " should "work" in {
// Bring back sql server when cascading rules can be set!
"A relation filter on a N:M self relation " should "work" taggedAs (IgnoreMsSql) in {

for (fieldName <- Vector("field_a", "field_z")) {
val project = ProjectDsl.fromString {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import util._
class DeeplyNestedSelfRelationSpec extends FlatSpec with Matchers with ApiSpecBase {
override def runOnlyForCapabilities = Set(JoinRelationLinksCapability)

"A deeply nested self relation create" should "be executed completely" in {
// Bring back sql server when cascading rules can be set!
"A deeply nested self relation create" should "be executed completely" taggedAs IgnoreMsSql in {
val project = ProjectDsl.fromString {
"""model User {
| id String @id @default(cuid())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import util._
class SameModelSelfRelationWithoutBackRelationSpec extends FlatSpec with Matchers with ApiSpecBase {
override def runOnlyForCapabilities = Set(JoinRelationLinksCapability)

"A Many to Many Self Relation" should "be accessible from only one side" in {
// Bring back sql server when cascading rules can be set!
"A Many to Many Self Relation" should "be accessible from only one side" taggedAs (IgnoreMsSql) in {
val testDataModels = {
val dm1 = """model Post {
id String @id @default(cuid())
Expand Down

0 comments on commit 96f8076

Please sign in to comment.