Skip to content

Commit 4264dae

Browse files
committed
test: replace @Ignore with @PendingFeature
- Use `@PendingFeature` so that the build fails if the test unexpectedly succeeds, providing an alert that the test passes.
1 parent b25d820 commit 4264dae

File tree

11 files changed

+33
-28
lines changed

11 files changed

+33
-28
lines changed

grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/CriteriaBuilderSpec.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package grails.gorm.tests
22

3-
import spock.lang.Ignore
3+
import spock.lang.PendingFeature
44

55
/**
66
* Abstract base test for criteria queries. Subclasses should do the necessary setup to configure GORM
@@ -31,7 +31,7 @@ class CriteriaBuilderSpec extends GormDatastoreSpec {
3131
result == 4
3232
}
3333

34-
@Ignore // ignored this test because the id() projection does not actually exist in GORM for Hibernate
34+
@PendingFeature(reason = 'ignored this test because the id() projection does not actually exist in GORM for Hibernate')
3535
void "Test id projection"() {
3636
given:
3737
def entity = new TestEntity(name:"Bob", age: 44, child:new ChildEntity(name:"Child")).save(flush:true)

grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/DomainEventsSpec.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import grails.gorm.DetachedCriteria
44
import grails.persistence.Entity;
55
import spock.lang.Issue
66

7-
import spock.lang.Ignore
7+
import spock.lang.PendingFeature
88

99
/**
1010
* @author graemerocher
@@ -265,7 +265,7 @@ class DomainEventsSpec extends GormDatastoreSpec {
265265
3 == PersonEvent.STORE.afterLoad
266266
}
267267

268-
@Ignore
268+
@PendingFeature(reason = 'Was previously @Ignore')
269269
void "Test bean autowiring"() {
270270
given:
271271
def personService = new Object()

grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/FirstAndLastMethodSpec.groovy

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ package grails.gorm.tests
22

33
import grails.persistence.Entity
44

5-
import spock.lang.Ignore
5+
import spock.lang.PendingFeature
66

7-
@Ignore
87
class FirstAndLastMethodSpec extends GormDatastoreSpec {
98

9+
@PendingFeature(reason = 'Was previously @Ignore')
1010
void "Test first and last method with empty datastore"() {
1111
given:
1212
assert SimpleWidget.count() == 0
@@ -24,6 +24,7 @@ class FirstAndLastMethodSpec extends GormDatastoreSpec {
2424
result == null
2525
}
2626

27+
@PendingFeature(reason = 'Was previously @Ignore')
2728
void "Test first and last method with multiple entities in the datastore"() {
2829
given:
2930
assert new SimpleWidget(name: 'one', spanishName: 'uno').save()
@@ -44,6 +45,7 @@ class FirstAndLastMethodSpec extends GormDatastoreSpec {
4445
result?.name == 'three'
4546
}
4647

48+
@PendingFeature(reason = 'Was previously @Ignore')
4749
void "Test first and last method with one entity"() {
4850
given:
4951
assert new SimpleWidget(name: 'one', spanishName: 'uno').save()
@@ -62,6 +64,7 @@ class FirstAndLastMethodSpec extends GormDatastoreSpec {
6264
result?.name == 'one'
6365
}
6466

67+
@PendingFeature(reason = 'Was previously @Ignore')
6568
void "Test first and last method with sort parameter"() {
6669
given:
6770
assert new SimpleWidget(name: 'one', spanishName: 'uno').save()
@@ -118,6 +121,7 @@ class FirstAndLastMethodSpec extends GormDatastoreSpec {
118121
result?.spanishName == 'uno'
119122
}
120123

124+
@PendingFeature(reason = 'Was previously @Ignore')
121125
void "Test first and last method with non standard identifier"() {
122126
given:
123127
['one', 'two', 'three'].each { name ->
@@ -138,6 +142,7 @@ class FirstAndLastMethodSpec extends GormDatastoreSpec {
138142
result?.name == 'three'
139143
}
140144

145+
@PendingFeature(reason = 'Was previously @Ignore')
141146
void "Test first and last method with composite key"() {
142147
given:
143148
assert new PersonWithCompositeKey(firstName: 'Steve', lastName: 'Harris', age: 56).save()

grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/GormEnhancerSpec.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package grails.gorm.tests
22

3-
import spock.lang.Ignore
3+
import spock.lang.PendingFeature
44

55
/**
66
* @author graemerocher
@@ -160,7 +160,7 @@ class GormEnhancerSpec extends GormDatastoreSpec {
160160
results.find { it.name == "Frank" } != null
161161
}
162162
163-
@Ignore
163+
@PendingFeature(reason = 'Was previously @Ignore')
164164
void "Test ilike query"() {
165165
given:
166166
def age = 40

grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/NamedQuerySpec.groovy

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ class NamedQuerySpec extends GormDatastoreSpec {
424424
'Some Recent Book' == publications[2].title
425425
}
426426

427-
@Ignore // queries on associations not yet supported
427+
@PendingFeature(reason = 'queries on associations not yet supported')
428428
void "Test named query with relationships in criteria"() {
429429

430430
given:
@@ -467,7 +467,7 @@ class NamedQuerySpec extends GormDatastoreSpec {
467467
'groovy' == results[0].name
468468
}
469469

470-
@Ignore // queries on associations not yet supported
470+
@PendingFeature(reason = 'queries on associations not yet supported')
471471
void "Test list distinct entities"() {
472472

473473
given:
@@ -499,7 +499,7 @@ class NamedQuerySpec extends GormDatastoreSpec {
499499
true == 'orange' in names
500500
}
501501

502-
@Ignore // queries on associations not yet supported
502+
@PendingFeature(reason = 'queries on associations not yet supported')
503503
void "Another test on listing distinct entities"() {
504504
given:
505505
new PlantCategory(name:"leafy")
@@ -681,8 +681,7 @@ class NamedQuerySpec extends GormDatastoreSpec {
681681
'Some New Book' == publications[0].title
682682
}
683683
684-
// findby boolean queries not yet supported
685-
@Ignore
684+
@PendingFeature(reason = 'findby boolean queries not yet supported')
686685
void "Test named query with findAll by boolean property"() {
687686
given:
688687
def Publication = ga.getDomainClass("Publication").clazz
@@ -702,8 +701,7 @@ class NamedQuerySpec extends GormDatastoreSpec {
702701
publications[1].title == 'Some Book'
703702
}
704703
705-
// findby boolean queries not yet supported
706-
@Ignore
704+
@PendingFeature(reason = 'findby boolean queries not yet supported')
707705
void "Test named query with find by boolean property"() {
708706
709707
given:
@@ -741,7 +739,7 @@ class NamedQuerySpec extends GormDatastoreSpec {
741739
3 == numberOfNewBooksNamedSomeBook
742740
}
743741
744-
@Ignore // list order by not yet supported
742+
@PendingFeature(reason = 'list order by not yet supported')
745743
void "Test named query with listOrderBy*() dynamic finder"() {
746744
747745
given:
@@ -825,7 +823,7 @@ class NamedQuerySpec extends GormDatastoreSpec {
825823
publication == null
826824
}
827825
828-
@Ignore
826+
@PendingFeature(reason = 'Was previously @Ignore')
829827
void "Test count method following named criteria"() {
830828
831829
given:

grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/QueryEventsSpec.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ import org.grails.datastore.mapping.query.event.PostQueryEvent
66
import org.grails.datastore.mapping.query.event.PreQueryEvent
77
import org.springframework.context.ApplicationEvent
88
import org.springframework.context.event.SmartApplicationListener
9-
import spock.lang.Ignore
9+
import spock.lang.PendingFeature
1010

1111
/**
1212
* Tests for query events.
1313
*/
14-
@Ignore
1514
class QueryEventsSpec extends GormDatastoreSpec {
1615
SpecQueryEventListener listener
1716

@@ -25,6 +24,7 @@ class QueryEventsSpec extends GormDatastoreSpec {
2524
session.datastore.applicationContext.addApplicationListener(listener)
2625
}
2726

27+
@PendingFeature(reason = 'Was previously @Ignore')
2828
void "pre-events are fired before queries are run"() {
2929
when:
3030
TestEntity.findByName 'bob'
@@ -45,6 +45,7 @@ class QueryEventsSpec extends GormDatastoreSpec {
4545
listener.PreExecution == 3
4646
}
4747

48+
@PendingFeature(reason = 'Was previously @Ignore')
4849
void "post-events are fired after queries are run"() {
4950
given:
5051
def entity = new TestEntity(name: 'bob').save(flush: true)

grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests/SessionCreationEventSpec.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ import org.springframework.context.event.SmartApplicationListener
44
import org.springframework.context.ApplicationEvent
55
import org.grails.datastore.mapping.core.SessionCreationEvent
66
import org.grails.datastore.mapping.core.Session
7-
import spock.lang.Ignore
7+
import spock.lang.PendingFeature
88

99
/**
1010
* Test case that session creation events are fired.
1111
*/
12-
@Ignore
1312
class SessionCreationEventSpec extends GormDatastoreSpec {
1413

1514
Listener listener
@@ -19,6 +18,7 @@ class SessionCreationEventSpec extends GormDatastoreSpec {
1918
session.datastore.applicationContext.addApplicationListener(listener)
2019
}
2120

21+
@PendingFeature(reason = 'Was previously @Ignore')
2222
void "test event for new session"() {
2323
when:"Using existing session"
2424
TestEntity.withSession { s ->

grails-datastore-gorm-test/src/test/groovy/grails/gorm/tests/WhereMethodSpec.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,8 @@ class Project {
11951195

11961196
}
11971197

1198-
@Ignore // rlike not suppported by all datastores yet
1198+
// Could we use @PendingFeatureIf here?
1199+
@Ignore('rlike not supported by all datastores yet')
11991200
def "Test rlike query"() {
12001201
given:"A bunch of people"
12011202
createPeople()

grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/CompositeIdentifierSpec.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ package org.grails.datastore.gorm
33
import grails.gorm.tests.GormDatastoreSpec
44
import grails.persistence.Entity
55

6-
import spock.lang.Ignore
6+
import spock.lang.PendingFeature
77

88
/**
99
* TODO: Support composite ids
1010
*/
11-
@Ignore
1211
class CompositeIdentifierSpec extends GormDatastoreSpec {
1312

13+
@PendingFeature(reason = 'Composite ids not supported')
1414
void "Test that a composite identifier is treated as assigned"() {
1515
given:"A domain model with a composite identifier"
1616
def u = new User(name: "Bob").save()

grails-datastore-gorm-test/src/test/groovy/org/grails/datastore/gorm/CustomTypeMarshallingSpec.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package org.grails.datastore.gorm
22

33
import grails.gorm.tests.GormDatastoreSpec
44
import grails.persistence.Entity
5-
import spock.lang.Ignore
65
import spock.lang.Issue
6+
import spock.lang.PendingFeature
77
import spock.lang.Shared
88

99
class CustomTypeMarshallingSpec extends GormDatastoreSpec {
@@ -50,7 +50,7 @@ class CustomTypeMarshallingSpec extends GormDatastoreSpec {
5050
}
5151

5252
@Issue("http://jira.grails.org/browse/GRAILS-8436")
53-
@Ignore
53+
@PendingFeature(reason = 'Was previously @Ignore')
5454
void "can re-save an existing instance without modifications"() {
5555
given:
5656
def p = Person.findByName("Fred")

0 commit comments

Comments
 (0)