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

move ocpapi to integration tests #736

Merged
merged 7 commits into from
Jun 21, 2024
Merged

move ocpapi to integration tests #736

merged 7 commits into from
Jun 21, 2024

Conversation

rayg1234
Copy link
Collaborator

@rayg1234 rayg1234 commented Jun 20, 2024

  • Move OCP api integration tests to its own workflow, will only be triggered when changes are made to src/fairchem/demo/ directory, tests ran by making a small change to "src/fairchem/demo/ocpapi/README.md"
  • re-enable some tests

@rayg1234 rayg1234 changed the title move to integration tests move ocpapi to integration tests Jun 20, 2024
lbluque
lbluque previously approved these changes Jun 20, 2024
Copy link
Collaborator

@lbluque lbluque left a comment

Choose a reason for hiding this comment

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

lgtm Thanks @rayg1234!

pytest tests -vv --skip-ocpapi-integration --cov-report=xml --cov=fairchem -c ./packages/fairchem-core/pyproject.toml
pytest tests -vv --ignore=tests/demo/ocpapi/tests/integration/ --cov-report=xml --cov=fairchem -c ./packages/fairchem-core/pyproject.toml

- name: Integration tests
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this run on every PR / commit on a PR? Or does it need to be targeted in some way?

These tests run the end to end demo so can get expensive if done on a CI workflow with lots of executions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

so the by default this was running on every PR, if we want we can remove from CI all together, wdyt?

Copy link
Collaborator

@kjmichel kjmichel Jun 21, 2024

Choose a reason for hiding this comment

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

Sorry, still catching up on how these tests are triggered. I assumed --skip-ocpapi-integration was skipping everything, but I think I understand now...

I would recommend adding --skip-ocpapi-integration to the command below. It was added in 2715160 in order to skip some especially expensive API calls (ones that are actually behind a pretty restrictive rate limiter as well). We don't want them to run on PRs, even if the errors are ignored.

In addition, I'm not sure the right test methods are decorated. These methods should have the decorator - they are very expensive and rate limited (I would not change them):

However, these methods are not very expensive. I'm not sure why they have the decorator (@misko ?). I would recommend removing it from:

Finally, this test does hit an expensive / rate-limited API. I would recommend adding the decorator to it:

Copy link
Collaborator

Choose a reason for hiding this comment

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

One question on adding continue-on-error: true...

What happens if someone changes the client code in this repo in a way that actually break it? I understand the motivation here - that we don't want to block builds because a remote API is not behaving correctly. But this will hide breaking code changes as well, won't it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved integration tests out and re-enabled the above tests, removed the continue-on-error

Copy link

codecov bot commented Jun 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

see 1 file with indirect coverage changes

Copy link
Collaborator

@kjmichel kjmichel left a comment

Choose a reason for hiding this comment

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

Looks good. Just one question inline.

And would you mind adding @pytest.mark.ocpapi_integration_test to https://github.com/FAIR-Chem/fairchem/blob/main/tests/demo/ocpapi/tests/integration/workflows/test_adsorbates.py#L73. It should have been there before.

pip install -e packages/fairchem-applications-cattsunami

- name: Integration tests
continue-on-error: true
Copy link
Collaborator

Choose a reason for hiding this comment

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

You mentioned in your comment that you removed this. Did you want to keep it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

opps, removing

Copy link
Collaborator

@kjmichel kjmichel left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks for doing all that!

Copy link
Collaborator

@lbluque lbluque left a comment

Choose a reason for hiding this comment

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

thanks @rayg1234

@lbluque lbluque added this pull request to the merge queue Jun 21, 2024
Merged via the queue into main with commit a0cf145 Jun 21, 2024
7 checks passed
@lbluque lbluque deleted the rgao_move_integration_tests branch June 21, 2024 16:54
levineds pushed a commit that referenced this pull request Jul 11, 2024
* move to integration tests

* remove code cov for integration

* move integration to separate workflow

* add change to see if integration test triggers

* remove skip markers

* change to on pull request

* add test back, remove continue-on-error
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.

3 participants