Skip to content

Commit

Permalink
🐛 Source Greenhouse: fix SAT from failed expected_records (#20515)
Browse files Browse the repository at this point in the history
  • Loading branch information
bazarnov authored Dec 15, 2022
1 parent 71d71a4 commit 3f0cffb
Show file tree
Hide file tree
Showing 3 changed files with 158 additions and 569 deletions.
17 changes: 13 additions & 4 deletions airbyte-integrations/connectors/source-greenhouse/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,26 @@ and place them into `secrets/config.json`.

### Locally running the connector
```
python main_dev.py spec
python main_dev.py check --config secrets/config.json
python main_dev.py discover --config secrets/config.json
python main_dev.py read --config secrets/config.json --catalog integration_tests/configured_catalog.json
python main.py spec
python main.py check --config secrets/config.json
python main.py discover --config secrets/config.json
python main.py read --config secrets/config.json --catalog integration_tests/configured_catalog.json
```

### Unit Tests
To run unit tests locally, from the connector directory run:
```
python -m pytest unit_tests
```
#### Acceptance Tests
Customize `acceptance-test-config.yml` file to configure tests. See [Source Acceptance Tests](https://docs.airbyte.io/connector-development/testing-connectors/source-acceptance-tests-reference) for more information.
If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py.
To run your integration tests with acceptance tests, from the connector root, run
```
docker build . --no-cache -t airbyte/source-greenhouse:dev \
&& python -m pytest integration_tests -p integration_tests.acceptance
```
To run your integration tests with docker

### Locally running the connector docker image

Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,89 @@
# See [Source Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/source-acceptance-tests-reference)
# for more information about how to configure these tests
connector_image: airbyte/source-greenhouse:dev
tests:
acceptance_tests:
spec:
- spec_path: "source_greenhouse/spec.json"
tests:
- spec_path: "source_greenhouse/spec.json"
connection:
- config_path: "secrets/config.json"
status: "succeed"
- config_path: "integration_tests/config_invalid.json"
status: "failed"
tests:
- config_path: "secrets/config.json"
status: "succeed"
- config_path: "integration_tests/config_invalid.json"
status: "failed"
discovery:
- config_path: "secrets/config.json"
- config_path: "secrets/config_users_only.json"
tests:
- config_path: "secrets/config.json"
- config_path: "secrets/config_users_only.json"
basic_read:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
expect_records:
path: "integration_tests/expected_records.txt"
- config_path: "secrets/config_users_only.json"
# test we do not fail when encounter 403 error
configured_catalog_path: "integration_tests/configured_catalog.json"
empty_streams: [
"applications", "applications_demographics_answers", "applications_interviews", "candidates", "close_reasons",
"custom_fields", "degrees", "demographics_answers", "demographics_answer_options", "questions",
"demographics_answers_answer_options", "demographics_question_sets", "demographics_question_sets_questions",
"departments", "jobs", "jobs_openings", "interviews", "job_posts", "job_stages", "jobs_stages", "offers",
"rejection_reasons", "scorecards", "sources", "demographics_questions"
]
tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
expect_records:
path: "integration_tests/expected_records.txt"
- config_path: "secrets/config_users_only.json"
# test we do not fail when encounter 403 error
configured_catalog_path: "integration_tests/configured_catalog.json"
empty_streams:
- name: "applications"
bypass_reason: "Could return 0 records because of rate limits"
- name: "applications_demographics_answers"
bypass_reason: "Could return 0 records because of rate limits"
- name: "applications_interviews"
bypass_reason: "Could return 0 records because of rate limits"
- name: "candidates"
bypass_reason: "Could return 0 records because of rate limits"
- name: "close_reasons"
bypass_reason: "Could return 0 records because of rate limits"
- name: "custom_fields"
bypass_reason: "Could return 0 records because of rate limits"
- name: "degrees"
bypass_reason: "Could return 0 records because of rate limits"
- name: "demographics_answers"
bypass_reason: "Could return 0 records because of rate limits"
- name: "demographics_answer_options"
bypass_reason: "Could return 0 records because of rate limits"
- name: "questions"
bypass_reason: "Could return 0 records because of rate limits"
- name: "demographics_answers_answer_options"
bypass_reason: "Could return 0 records because of rate limits"
- name: "demographics_question_sets"
bypass_reason: "Could return 0 records because of rate limits"
- name: "demographics_question_sets_questions"
bypass_reason: "Could return 0 records because of rate limits"
- name: "departments"
bypass_reason: "Could return 0 records because of rate limits"
- name: "jobs"
bypass_reason: "Could return 0 records because of rate limits"
- name: "jobs_openings"
bypass_reason: "Could return 0 records because of rate limits"
- name: "interviews"
bypass_reason: "Could return 0 records because of rate limits"
- name: "job_posts"
bypass_reason: "Could return 0 records because of rate limits"
- name: "job_stages"
bypass_reason: "Could return 0 records because of rate limits"
- name: "jobs_stages"
bypass_reason: "Could return 0 records because of rate limits"
- name: "offers"
bypass_reason: "Could return 0 records because of rate limits"
- name: "rejection_reasons"
bypass_reason: "Could return 0 records because of rate limits"
- name: "scorecards"
bypass_reason: "Could return 0 records because of rate limits"
- name: "sources"
bypass_reason: "Could return 0 records because of rate limits"
- name: "demographics_questions"
bypass_reason: "Could return 0 records because of rate limits"
full_refresh:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
- config_path: "secrets/config_users_only.json"
configured_catalog_path: "integration_tests/configured_catalog_users_only.json"
tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
- config_path: "secrets/config_users_only.json"
configured_catalog_path: "integration_tests/configured_catalog_users_only.json"
incremental:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/incremental_configured_catalog.json"
future_state_path: "integration_tests/abnormal_state.json"
tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/incremental_configured_catalog.json"
future_state:
future_state_path: "integration_tests/abnormal_state.json"
Loading

0 comments on commit 3f0cffb

Please sign in to comment.