Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: improve unit tests quality and coverage #433

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

Open
fritznastor wants to merge 10 commits into coderamp-labs:main
base: main
Choose a base branch
Loading
from fritznastor:improve-unit-tests

Conversation

Copy link

@fritznastor fritznastor commented Jul 21, 2025
edited by ix-56h
Loading

Closes #354

test_flow_integration.py improvements

Here is what I did so far:

  • Switched to a Realistic Public Repository (microsoft/vscode)
  • Expanded Success Path Assertions
  • Added Negative and Edge Case Tests
  • Rate-Limiting and Status Code Tolerance

Copy link
Contributor

@ix-56h ix-56h left a comment

Choose a reason for hiding this comment

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

It's a good start.
We going to merge #427 soon and we have some more typing restriction (for example max_file_size is a int now).

Also, don't be afraid to create a dedicated repo with weird stuff to make specific testing.

Finally, we have a lot of thing to test :

  • Specific commits
  • Specific tag
  • Weird encoding
  • Specific paths
  • Blob files

fritznastor reacted with thumbs up emoji
-lowered max file size from 243 to 200 for all unit tests
-correctly handled missing fields and invalid token unit tests
Copy link
Author

fritznastor commented Jul 24, 2025
edited
Loading

Hey again @ix-56h, I was able to make some hot fixes to my original additions.

Regarding the merge of #427 , do you want me to modify max_file_size to reflect the upcoming typing restriction from str to int? Or should I wait after you and @filipchristiansen merge #427.

Furthermore. since this is my first time contributing to an open source, I'm going to ask a lot of clarifying questions to help me contribute better!

I need some direction/guidance on how to "create a dedicated repo with weird stuff to make specific testing." Any advice on how to begin doing this? I figured I'd start on this dedicated repo after I finished polishing up the rest of the test files that are listed as priority

Copy link
Author

I'll wait on modifying test_git_utils.py for now until the first two files are all good.

ix-56h reacted with thumbs up emoji

Copy link
Contributor

@ix-56h ix-56h left a comment

Choose a reason for hiding this comment

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

This is pretty good so far !

Copy link
Author

Hey @ix-56h, I believe test_flow_integration.py and test_ingestion.py are all good now. Let me know if you think of any other specific/weird tests I can add on.

I also added a few test cases to test_git_utils.py for you to review.

Copy link
Author

The modified test files should be good to go now, I think it's ready to be merged with main.

Copy link

This pull request has merge conflicts that must be resolved before it can be merged.

Copy link
Author

@fritznastor fritznastor left a comment

Choose a reason for hiding this comment

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

Rebased to main. No change to actual files.

Copy link
Author

Hey @ix-56h, it's saying that I have merge conflicts in test_flow_integration.py, but I'm looking at the file right now and I see none at all, can you figure out why it's bugging out? Thanks man.

Copy link
Contributor

ix-56h commented Jul 30, 2025

Copy link

This pull request has resolved merge conflicts and is ready for review.

Copy link
Author

Hey @filipchristiansen, do you think you can check this out real quick, I appreciate it!

Copy link
Contributor

Hey @filipchristiansen, do you think you can check this out real quick, I appreciate it!

I'm away on Iceland until early next week, maybe @NicolasIRAGNE can have a look at it?

fritznastor reacted with thumbs up emoji

Copy link
Author

Hey @NicolasIRAGNE, do you have some time to check out my changes!

Copy link
Contributor

Hello @fritznastor !
sorry for the time I took to answer -- I've been a bit busy these days.

Thanks a lot for the PR -- unfortunately, I think this is not the direction we want to take for tests and they need a major, if not complete rewrite.

There needs to be no external calls at all, otherwise they're unreliable and may cause errors based on external factors (which is currently happening pretty often in current CI)

Copy link
Author

fritznastor commented Aug 5, 2025
edited
Loading

Hey @NicolasIRAGNE , thanks for getting back to me, @ix-56h thought that my updates to the test suite were pretty good, do you mind explaining more about what I should do?

Specifically:
Should I be mocking all external repo access and simulating Git responses instead of using real repos like flask or vscode?

Is there an internal fixture or preferred test structure you'd like me to follow when testing edge cases like binary files, symlinks, etc.?

Lastly, would it be more helpful for me to focus on unit tests with mocked I/O rather than higher-level integration scenarios?

I’m happy to do a rewrite that better fits the project’s goals—I want to make sure I’m going about it the right way.

Copy link

This pull request has merge conflicts that must be resolved before it can be merged.

Copy link

Hi there! We haven’t seen activity on this pull request for 45 days, so I’m marking it as stale.
If you’d like to keep it open, please leave a comment within 10 days. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@ix-56h ix-56h ix-56h approved these changes

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

feat: improve unit tests quality and coverage

AltStyle によって変換されたページ (->オリジナル) /