From 47a640fc9e1ffcc1b8202ee6a07864ea7d5708cd Mon Sep 17 00:00:00 2001 From: Tim Grein Date: Fri, 8 Dec 2023 10:45:13 +0100 Subject: [PATCH] [Connectors API] Check the created sync job in the post connector sync job integration tests (#103136) Add verifications of the values of a created sync job to the integration tests. --- .../entsearch/400_connector_sync_job_post.yml | 59 ++++++++++++++++++- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/ent-search/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/entsearch/400_connector_sync_job_post.yml b/x-pack/plugin/ent-search/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/entsearch/400_connector_sync_job_post.yml index 055221b917cb1..0403842cb0728 100644 --- a/x-pack/plugin/ent-search/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/entsearch/400_connector_sync_job_post.yml +++ b/x-pack/plugin/ent-search/qa/rest/src/yamlRestTest/resources/rest-api-spec/test/entsearch/400_connector_sync_job_post.yml @@ -20,28 +20,83 @@ setup: id: test-connector job_type: full trigger_method: on_demand + - set: { id: id } + + - match: { id: $id } + + - do: + connector_sync_job.get: + connector_sync_job_id: $id + + - match: { connector.id: test-connector} + - match: { job_type: full } + - match: { trigger_method: on_demand } + - match: { status: pending } + - match: { total_document_count: 0 } + - match: { indexed_document_count: 0 } + - match: { indexed_document_volume: 0 } + - match: { deleted_document_count: 0 } - match: { id: $id } + - exists: created_at + - exists: last_seen + --- -'Create connector sync job with missing job type': +'Create connector sync job with missing job type - expect job type full as default': - do: connector_sync_job.post: body: id: test-connector trigger_method: on_demand + - set: { id: id } + - match: { id: $id } + - do: + connector_sync_job.get: + connector_sync_job_id: $id + + - match: { connector.id: test-connector } + - match: { job_type: full } + - match: { trigger_method: on_demand } + - match: { status: pending } + - match: { total_document_count: 0 } + - match: { indexed_document_count: 0 } + - match: { indexed_document_volume: 0 } + - match: { deleted_document_count: 0 } + - match: { id: $id } + - exists: created_at + - exists: last_seen + --- -'Create connector sync job with missing trigger method': +'Create connector sync job with missing trigger method - expect trigger method on_demand as default': - do: connector_sync_job.post: body: id: test-connector job_type: full + - set: { id: id } + + - match: { id: $id } + + - do: + connector_sync_job.get: + connector_sync_job_id: $id + + - match: { connector.id: test-connector } + - match: { job_type: full } + - match: { trigger_method: on_demand } + - match: { status: pending } + - match: { total_document_count: 0 } + - match: { indexed_document_count: 0 } + - match: { indexed_document_volume: 0 } + - match: { deleted_document_count: 0 } - match: { id: $id } + - exists: created_at + - exists: last_seen --- 'Create connector sync job with non-existing connector id':