Skip to content

Commit

Permalink
[Connectors API] Check the created sync job in the post connector syn…
Browse files Browse the repository at this point in the history
…c job integration tests (elastic#103136)

Add verifications of the values of a created sync job to the integration tests.
  • Loading branch information
timgrein authored Dec 8, 2023
1 parent b9c2980 commit 47a640f
Showing 1 changed file with 57 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit 47a640f

Please sign in to comment.