Skip to content

Conversation

@HugoOnghai
Copy link
Collaborator

Summary

Used pytest to test our understanding of how we ought to interact with the elinkapi.

  • conf_test.py (originally conftest) tests instantiating the review and production clients (in pytest fixtures) and then uses those to test getting single records and queries.
  • elink_service_test.py also tests the querying function, but may be expanded in the future.
  • elinkapi_test.py is primarily code from the elinkapi repository's own tests. It tests posting (saving and submitting), getting newly posted records (and comparing the response to what was originally posted), reserving DOIs, updating records, and getting revision numbers.

The Testing Workflow

  • testing.yml
  • uses uv to initialize a virtual environment to install the project into and run the tests
  • packages are installed by calling uv sync, which installs all dependencies outlined in uv.lock. additional packages can be added to uv.lock by either uv pip install [package name] or uv add [package name]
  • To pass environment variables into github workflow, GitHub secrets were made, which function very similar to the contents and keywords of a .env file.

@HugoOnghai HugoOnghai force-pushed the testing-suite branch 2 times, most recently from 6bb3238 to c6be708 Compare August 6, 2025 20:37
HugoOnghai and others added 23 commits August 7, 2025 09:55
…ink found bug with rows greater than 100 on ElinkAPI query_records (144845 dois under 10.17188, 12 are not titled Materials Data On... (edge cases), 144833 Materials have DOIs)
* move old code to 'legacy'

* setup project using uv

* add license

* testing skeleton

* gh actions skeleton

* remove old reqs file to prevent dependabot alerts

---------

Co-authored-by: Tyler Mathis <35553152+tsmathis@users.noreply.github.com>
…re-commit since they aren't being seen as accessed
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