Skip to content

Commit

Permalink
Merge pull request #170 from grails/matrei/ignored-tests
Browse files Browse the repository at this point in the history
Change `@Ignore` tests to `@PendingFeature`
  • Loading branch information
matrei authored Dec 16, 2024
2 parents 4601b64 + c394e60 commit 6a31423
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 78 deletions.
23 changes: 8 additions & 15 deletions examples/pubsub-demo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
plugins {
id 'application'
id 'groovy'
id 'org.grails.grails-web'
id 'org.grails.plugins.views-json'
}

version = rootProject.version
group = 'pubsub.demo'
configurations.all {

resolutionStrategy.dependencySubstitution {
substitute module("org.codehaus.groovy:groovy") using module('org.apache.groovy:groovy:4.0.22')
substitute module("org.codehaus.groovy:groovy-templates") using module('org.apache.groovy:groovy-templates:4.0.22')
substitute module("org.codehaus.groovy:groovy-xml") using module('org.apache.groovy:groovy-xml:4.0.22')
substitute module("org.codehaus.groovy:groovy-json") using module('org.apache.groovy:groovy-json:4.0.22')
}
}

// Must be applied after version is set
apply plugin: 'org.grails.grails-web'

dependencies {

implementation project(':grails-plugin-async')
Expand All @@ -30,8 +23,7 @@ dependencies {
implementation 'org.grails:grails-web-boot'

implementation 'org.grails.plugins:hibernate5'
implementation libs.grails.views.json
implementation libs.grails.views.json.templates
implementation 'org.grails.plugins:views-json'

implementation 'org.springframework.boot:spring-boot-autoconfigure'
implementation 'org.springframework.boot:spring-boot-starter'
Expand All @@ -40,7 +32,8 @@ dependencies {
implementation libs.micronaut.serde.jackson

runtimeOnly 'com.h2database:h2'
runtimeOnly 'org.apache.tomcat:tomcat-jdbc'
runtimeOnly 'org.fusesource.jansi:jansi'
runtimeOnly 'com.zaxxer:HikariCP'

testImplementation libs.micronaut.http.client
testImplementation 'org.grails:grails-web-testing-support'
Expand Down
92 changes: 44 additions & 48 deletions examples/pubsub-demo/grails-app/conf/application.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,48 @@
info:
app:
name: '@info.app.name@'
version: '@info.app.version@'
grailsVersion: '@info.app.grailsVersion@'
app:
name: '@info.app.name@'
version: '@info.app.version@'
grailsVersion: '@info.app.grailsVersion@'
grails:
views:
default:
codec: html
gorm:
reactor:
events: false
mime:
disable:
accept:
header:
userAgents:
- Gecko
- WebKit
- Presto
- Trident
types:
json:
- application/json
- text/json
hal:
- application/hal+json
- application/hal+xml
xml:
- text/xml
- application/xml
atom: application/atom+xml
css: text/css
csv: text/csv
js: text/javascript
rss: application/rss+xml
text: text/plain
all: '*/*'
views:
default:
codec: html
mime:
disable:
accept:
header:
userAgents:
- Gecko
- WebKit
- Presto
- Trident
types:
json:
- application/json
- text/json
hal:
- application/hal+json
- application/hal+xml
xml:
- text/xml
- application/xml
atom: application/atom+xml
css: text/css
csv: text/csv
js: text/javascript
rss: application/rss+xml
text: text/plain
all: '*/*'
dataSource:
url: jdbc:h2:mem:devDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
driverClassName: org.h2.Driver
username: sa
password: ''
pooled: true
jmxExport: true
dbCreate: create-drop
url: jdbc:h2:mem:devDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
driverClassName: org.h2.Driver
username: sa
password: ''
pooled: true
jmxExport: true
hibernate:
hbm2ddl:
auto: update
cache:
queries: false
use_second_level_cache: false
use_query_cache: false
cache:
queries: false
use_second_level_cache: false
use_query_cache: false
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package pubsub.demo
import grails.gorm.transactions.Rollback
import grails.testing.mixin.integration.Integration
import jakarta.inject.Inject
import spock.lang.Ignore
import spock.lang.Specification
import spock.util.concurrent.PollingConditions

Expand Down Expand Up @@ -68,7 +67,6 @@ class PubSubSpec extends Specification {


@Rollback
@Ignore
void 'Test synchronous event listener'() {

when: 'when a event listener cancels an insert'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import io.micronaut.http.HttpStatus
import io.micronaut.http.client.HttpClient
import io.micronaut.http.client.exceptions.HttpClientResponseException
import spock.lang.AutoCleanup
import spock.lang.Ignore
import spock.lang.PendingFeature
import spock.lang.Shared
import spock.lang.Specification

Expand All @@ -25,7 +25,11 @@ class TaskControllerSpec extends Specification {
client = HttpClient.create("http://localhost:$serverPort".toURL())
}

@Ignore
@PendingFeature(reason = '''
For some reason the response body is blank with bootTestRun.
However, when starting the application with bootRun,
the response body is as expected.
''')
void 'test async error handling'() {

when: 'we invoke an endpoint that throws an exception'
Expand Down
4 changes: 1 addition & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,4 @@ spring-test = { module = 'org.springframework:spring-test' }
spring-tx = { module = 'org.springframework:spring-tx' }
spring-web = { module = 'org.springframework:spring-web' }
micronaut-serde-jackson = { module = 'io.micronaut.serde:micronaut-serde-jackson', version.ref = 'micronaut-serde-jackson' }
micronaut-http-client = { module = 'io.micronaut:micronaut-http-client', version.ref = 'micronaut-http-client' }
grails-views-json = { module = 'org.grails.plugins:views-json' }
grails-views-json-templates = { module = 'org.grails.plugins:views-json-templates' }
micronaut-http-client = { module = 'io.micronaut:micronaut-http-client', version.ref = 'micronaut-http-client' }
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2013 SpringSource
* Copyright 2013-2024 the original author or authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -15,7 +15,7 @@
*/
package grails.async

import spock.lang.Ignore
import spock.lang.PendingFeature
import spock.lang.Specification
import spock.util.concurrent.PollingConditions

Expand Down Expand Up @@ -97,7 +97,7 @@ class PromiseMapSpec extends Specification {
err.message == 'java.lang.RuntimeException: bad'
}

@Ignore('''
@PendingFeature(reason = '''
This test fails because the chained call to then does not use the
map returned from the previous closure. So the same first map
is returned over and over.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.grails.async.factory.rxjava

import grails.async.PromiseMap
import spock.lang.Ignore
import spock.lang.PendingFeature
import spock.lang.Specification
import spock.util.concurrent.PollingConditions

Expand Down Expand Up @@ -86,7 +86,7 @@ class RxJavaPromiseMapSpec extends Specification{
}
}

@Ignore('''
@PendingFeature(reason = '''
This test fails because the chained call to then does not use the
map returned from the previous closure. So the same first map
is returned over and over.
Expand All @@ -97,10 +97,8 @@ class RxJavaPromiseMapSpec extends Specification{
def map = new PromiseMap()
map['one'] = { 1 }
def promise = map.then {
println it
it['four'] = 4; it
}.then {
println it
it['eight'] = 8; it
}
def result = promise.get()
Expand Down

0 comments on commit 6a31423

Please sign in to comment.