elastic / connectors

Source code for all Elastic connectors, developed by the Search team at Elastic, and home of our Python connector development framework
https://www.elastic.co/guide/en/enterprise-search/master/index.html
Other
58 stars 116 forks source link

Add set_env to tests that init elasticsearch client #2649

Closed artem-shelkovnikov closed 1 week ago

artem-shelkovnikov commented 1 week ago

Example failures:


FAILED tests/protocol/test_connectors.py::test_create_job_with_connector_api[JobTriggerMethod.SCHEDULED-JobType.INCREMENTAL] - ValueError: Strict mode enabled, variables $elasticsearch.password are not defined!
--
  | FAILED tests/protocol/test_connectors.py::test_create_job_with_connector_api[JobTriggerMethod.ON_DEMAND-JobType.FULL] - ValueError: Strict mode enabled, variables $elasticsearch.password are not defined!

It happens because the tests are not using set_env fixture - original configuration file that's used for these tests does not have actual elasticsearch configuration definitions, it uses variables. These variables are populated from ENV.

Sometimes these tests pass because previous tests already defined these environment variables. To avoid these tests being flaky I just use set_env fixture in more tests.

artem-shelkovnikov commented 1 week ago

cc @jedrazb, that's some arcane magic here :D

github-actions[bot] commented 1 week ago

💔 Failed to create backport PR(s)

The backport operation could not be completed due to the following error: There are no branches to backport to. Aborting.

The backport PRs will be merged automatically after passing CI.

To backport manually run: backport --pr 2649 --autoMerge --autoMergeMethod squash