[Watcher] Enable Jira integration tests (elastic/elasticsearch#4331)

This commit enables the Jira integration tests with the Jira project and account provided by Edward Sy.

closes elastic/infraelastic/elasticsearch#1498

Original commit: elastic/x-pack-elasticsearch@78d1005064
This commit is contained in:
Tanguy Leroux 2017-01-05 13:44:04 +01:00 committed by GitHub
parent 9f43a5320e
commit 125a2c9c03
2 changed files with 19 additions and 19 deletions

View File

@ -7,10 +7,6 @@ dependencies {
}
integTest {
// JIRA integration tests are ignored until a JIRA server is available for testing
// see https://github.com/elastic/infra/issues/1498
systemProperty 'tests.rest.blacklist', 'actions/20_jira/*'
cluster {
plugin ':x-pack:elasticsearch'
setting 'xpack.security.enabled', 'false'
@ -21,13 +17,17 @@ integTest {
// Need to allow more compilations per minute because of the integration tests
setting 'script.max_compilations_per_minute', '100'
//
// JIRA integration test settings
setting 'xpack.notification.jira.account.test.url', 'http://localhost:8080'
setting 'xpack.notification.jira.account.test.allow_http', 'true'
setting 'xpack.notification.jira.account.test.user', 'jira_user'
setting 'xpack.notification.jira.account.test.password', 'secret'
setting 'xpack.notification.jira.account.test.issue_defaults.project.key', 'BAS'
//
// The integration tests use a JIRA account on elasticsearch.atlassian.net. This account
// has been created by Edward Sy [edward@elastic.co]. It uses the "XPACK WATCHER TEST"
// Jira project available at https://elasticsearch.atlassian.net/projects/XWT/issues/?filter=allopenissues
// and the "xpack-user@elastic.co" username which is also an internal Google Group.
setting 'xpack.notification.jira.account.test.url', 'https://elasticsearch.atlassian.net/'
setting 'xpack.notification.jira.account.test.user', 'xpack-user@elastic.co'
setting 'xpack.notification.jira.account.test.password', 'N9M4ea9rfy'
setting 'xpack.notification.jira.account.test.issue_defaults.project.key', 'XWT'
setting 'xpack.notification.jira.account.test.issue_defaults.labels', ['integration-tests']
}
}

View File

@ -14,7 +14,7 @@
},
"trigger": {
"schedule": {
"interval": "1s"
"interval": "1d"
}
},
"input": {
@ -30,7 +30,7 @@
"account": "test",
"fields": {
"summary": "{{ctx.metadata.custom_title}} {{ctx.watch_id}}",
"description": "Issue created by the REST integration test [/watcher/actions/10_jira.yaml]",
"description": "Issue created by the REST integration test [/watcher/actions/20_jira.yaml]",
"issuetype" : {
"name": "Bug"
}
@ -85,10 +85,10 @@
- match: { hits.hits.0._source.result.actions.0.jira.account: "test" }
- match: { hits.hits.0._source.result.actions.0.jira.fields.summary: "Hello from jira_watch" }
- match: { hits.hits.0._source.result.actions.0.jira.fields.issuetype.name: "Bug" }
- match: { hits.hits.0._source.result.actions.0.jira.fields.project.key: "BAS" }
- match: { hits.hits.0._source.result.actions.0.jira.fields.project.key: "XWT" }
- match: { hits.hits.0._source.result.actions.0.jira.fields.labels.0: "integration-tests" }
- match: { hits.hits.0._source.result.actions.0.jira.result.id: /\d+/ }
- match: { hits.hits.0._source.result.actions.0.jira.result.key: /BAS-\d+/ }
- match: { hits.hits.0._source.result.actions.0.jira.result.key: /XWT-\d+/ }
- match: { hits.hits.0._source.result.actions.0.jira.result.self: /http(.)*/ }
- set: { hits.hits.0._id: id }
@ -100,7 +100,7 @@
body:
query:
match:
result.actions.jira.fields.project.key: "BAS"
result.actions.jira.fields.project.key: "XWT"
- match: { hits.total: 1 }
- match: { hits.hits.0._id: $id }
- match: { hits.hits.0._source.result.actions.0.jira.result.self: $self }
@ -205,12 +205,12 @@
- match: { hits.hits.0._source.result.actions.0.jira.account: "test" }
- match: { hits.hits.0._source.result.actions.0.jira.fields.summary: "Hello from wrong_jira_watch" }
- is_false: hits.hits.0._source.result.actions.0.jira.fields.issuetype.name
- match: { hits.hits.0._source.result.actions.0.jira.fields.project.key: "BAS" }
- match: { hits.hits.0._source.result.actions.0.jira.fields.project.key: "XWT" }
- match: { hits.hits.0._source.result.actions.0.jira.fields.labels.0: "integration-tests" }
- match: { hits.hits.0._source.result.actions.0.jira.reason: "Bad Request - Field [issuetype] has error [issue type is required]\n" }
- match: { hits.hits.0._source.result.actions.0.jira.request.method: "post" }
- match: { hits.hits.0._source.result.actions.0.jira.request.path: "/rest/api/2/issue" }
- match: { hits.hits.0._source.result.actions.0.jira.request.auth.basic.username: "jira_user" }
- match: { hits.hits.0._source.result.actions.0.jira.request.auth.basic.username: "xpack-user@elastic.co" }
- is_false: hits.hits.0._source.result.actions.0.jira.request.auth.basic.password
- match: { hits.hits.0._source.result.actions.0.jira.response.body: "{\"errorMessages\":[],\"errors\":{\"issuetype\":\"issue type is required\"}}" }
@ -244,7 +244,7 @@
"account": "test",
"fields": {
"summary": "Jira watch with custom field of string type",
"description": "Issue created by the REST integration test [/watcher/actions/10_jira.yaml]",
"description": "Issue created by the REST integration test [/watcher/actions/20_jira.yaml]",
"issuetype" : {
"name": "Bug"
},
@ -295,7 +295,7 @@
"account": "test",
"fields": {
"summary": "Jira watch with custom field of object (Jira's CascadingSelectField) type",
"description": "Issue created by the REST integration test [/watcher/actions/10_jira.yaml]",
"description": "Issue created by the REST integration test [/watcher/actions/20_jira.yaml]",
"issuetype" : {
"name": "Bug"
},