Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration tests in CI #5

Merged
merged 3 commits into from
Apr 4, 2024
Merged

Integration tests in CI #5

merged 3 commits into from
Apr 4, 2024

Conversation

maxjakob
Copy link
Collaborator

@maxjakob maxjakob commented Mar 28, 2024

Run integration tests in CI.

  • Remove check for OPENAI_API_KEY because this key is actually not required
  • Create ES service in GitHub Action environment
  • Check if a model is deployed in ES to determine if a test needs to be skipped
  • Some refactoring for the previous point
  • Remove obsolete compile test

@maxjakob maxjakob force-pushed the ci-integration-tests branch 8 times, most recently from ec8a032 to 59e72e4 Compare April 3, 2024 10:12
@maxjakob maxjakob force-pushed the ci-integration-tests branch from 59e72e4 to 622ba5d Compare April 3, 2024 10:14
@maxjakob maxjakob changed the title Ci integration tests Integration tests in CI Apr 3, 2024
@maxjakob maxjakob marked this pull request as ready for review April 3, 2024 10:19
@maxjakob maxjakob requested a review from efriis April 3, 2024 10:20
Copy link
Member

@efriis efriis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should work!

  • the reason we test for "compiling integration tests" but don't actually run them in check_diffs.yml (which runs on every PR) is because integration tests typically rely on secrets, which are not available when PRs come from forks (e.g. community contributions). It seems your integration tests don't rely on any secrets, so this could work.
  • my light suggestion would be to reformat some of these "integration tests" as "unit tests" (if you want to rename those two folders to "pr tests" and "release tests" that works for me). That way you can keep the integration testing folder if you ever wanted to run release integration tests to make sure cloud connection is working, or integration with other components that need api keys works.

But will defer to you, and lmk if you have questions!

@maxjakob
Copy link
Collaborator Author

maxjakob commented Apr 4, 2024

Appreciate the feedback @efriis!

It seems your integration tests don't rely on any secrets, so this could work.

Exactly they don't and I would argue that for this Elasticsearch package we can keep secrets out of the tests going forward since we can stub the other parts (like embeddings).

my light suggestion would be to reformat some of these "integration tests" as "unit tests" (if you want to rename those two folders to "pr tests" and "release tests" that works for me)

I had a look through the integration tests but didn't find an instance that could be ported to a unit test (that can run without ES). Regarding the distinction between PR pushes and merges to main: the integration tests currently take less than a minute in CI including ES setup. From my perspective this is acceptable to run on each push to a PR.

That way you can keep the integration testing folder if you ever wanted to run release integration tests to make sure cloud connection is working [...]

It's still possible to run the integration tests locally pointing at a cloud instance so I think we don't loose this option with this PR.

@maxjakob maxjakob merged commit 89fafbe into main Apr 4, 2024
11 checks passed
@maxjakob maxjakob deleted the ci-integration-tests branch April 4, 2024 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants