Skip to content

Add integration tests for file objects#802

Open
gmazoyer wants to merge 2 commits intoinfrahub-developfrom
gma-20260206-ihs193-integration-tests
Open

Add integration tests for file objects#802
gmazoyer wants to merge 2 commits intoinfrahub-developfrom
gma-20260206-ihs193-integration-tests

Conversation

@gmazoyer
Copy link
Contributor

@gmazoyer gmazoyer commented Feb 6, 2026

These tests won't pass yet, as we need the upcoming Infrahub 1.8 to run them, hence marking them as XFAIL for now.

Summary by CodeRabbit

  • Tests
    • Added comprehensive integration tests and supporting fixtures for FileObject lifecycle: uploads (bytes/path), updates and upserts, downloads (memory and disk), metadata validation (name, size, checksum, storage id), and relationship-based queries — covering both asynchronous and synchronous flows, plus schema-loading and node-creation fixtures to exercise relational scenarios.

These tests won't pass yet, as we need the upcoming Infrahub 1.8 to run
them, hence marking them as XFAIL for now.
@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

Walkthrough

Added infrahub_sdk/testing/schemas/file_object.py, which defines NodeSchema fixtures FileContract and Circuit, composes a SchemaRoot, and provides async/sync fixtures to load the schema and create/persist Circuit nodes. Added tests/integration/test_file_object.py containing async (TestFileObjectAsync) and sync (TestFileObjectSync) integration suites that exercise FileObject lifecycle: creation from bytes and path, metadata checks, updates with new files, upsert behavior, downloads to memory and disk, attribute-only updates, and querying contracts via the circuit relationship.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 63.16% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add integration tests for file objects' accurately summarizes the main change: adding comprehensive integration tests for file object functionality.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 6, 2026

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 327143c
Status: ✅  Deploy successful!
Preview URL: https://d647c2fc.infrahub-sdk-python.pages.dev
Branch Preview URL: https://gma-20260206-ihs193-integrat.infrahub-sdk-python.pages.dev

View logs

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 89.47368% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
infrahub_sdk/testing/schemas/file_object.py 89.47% 4 Missing ⚠️
@@                 Coverage Diff                  @@
##           infrahub-develop     #802      +/-   ##
====================================================
+ Coverage             80.32%   80.49%   +0.16%     
====================================================
  Files                   115      118       +3     
  Lines                  9867    10264     +397     
  Branches               1504     1547      +43     
====================================================
+ Hits                   7926     8262     +336     
- Misses                 1420     1466      +46     
- Partials                521      536      +15     
Flag Coverage Δ
integration-tests 40.41% <89.47%> (-1.03%) ⬇️
python-3.10 51.64% <0.00%> (+0.27%) ⬆️
python-3.11 51.66% <0.00%> (+0.29%) ⬆️
python-3.12 51.66% <0.00%> (+0.29%) ⬆️
python-3.13 51.66% <0.00%> (+0.29%) ⬆️
python-3.14 53.35% <0.00%> (+0.33%) ⬆️
python-filler-3.12 23.91% <0.00%> (-0.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
infrahub_sdk/testing/schemas/file_object.py 89.47% <89.47%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmazoyer gmazoyer marked this pull request as ready for review February 6, 2026 14:19
@gmazoyer gmazoyer requested a review from a team as a code owner February 6, 2026 14:19
@gmazoyer gmazoyer force-pushed the gma-20260206-ihs193-integration-tests branch from be55b41 to 327143c Compare February 6, 2026 16:50
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.

1 participant