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

Start at moving tests for git module ⚡️ #462

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

lwasser
Copy link

@lwasser lwasser commented Nov 23, 2021

This is ready for a review. I still am struggling to raise a filenotfound see #468 and also we need to resolve how we want to handle commit messages: see: #466

#466 #465 are related to this PR and could be addressed here as well potentially

i'm slowly updating docstrings as i write tests.

There is also a general question about some of the git / github functionality. it's easy to test git operations that don't hit github because authentication doesn't seem to be an issue. you can run git status for instance and it just works. But if we use SSH we can't really clone or pull without it benign setup and doing that on ci is tricky.

So one option is to have a suite of tests that only run locally. but even then pushing to a random repo seems a bit tricky too as it does require permissions that a new dev may not have. so i'm not sure how to do this without a good bit of mocking.

@codecov
Copy link

codecov bot commented Nov 23, 2021

Codecov Report

Attention: Patch coverage is 99.09910% with 1 line in your changes missing coverage. Please review.

Project coverage is 66.48%. Comparing base (f680b89) to head (8059dd6).
Report is 38 commits behind head on main.

Files with missing lines Patch % Lines
abcclassroom/tests/test_git.py 99.07% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #462      +/-   ##
==========================================
+ Coverage   60.61%   66.48%   +5.86%     
==========================================
  Files          20       20              
  Lines        1163     1265     +102     
==========================================
+ Hits          705      841     +136     
+ Misses        458      424      -34     
Flag Coverage Δ
unittests 66.48% <99.09%> (+5.86%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

assert captured_output[0].startswith("Encountered this error")


# NOTE: Updated to run git status so it works universally
Copy link
Author

Choose a reason for hiding this comment

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

@kcranston there is a bigger question here about how much we mock. Right now the big stumbling block is ssh setup for git clone but here i mean git status is easy to just run. Because you run git commit below and it's fine i may update this test to avoid any mocks.

# and you try to run _call_git?


def test_clone_repo_pass(monkeypatch, example_student_repo, capsys, tmp_path):
Copy link
Author

@lwasser lwasser Nov 23, 2021

Choose a reason for hiding this comment

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

this could run IF we could figure out authentication. i really do not understand how to do that part in a way that it works on ci.

@lwasser
Copy link
Author

lwasser commented Jan 27, 2022

consider pulling out updates to the code base vs tests...

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