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

Merging #462 (8059dd6) into main (f680b89) will increase coverage by 5.86%.
The diff coverage is 99.09%.

Impacted file tree graph

@@            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.

Impacted Files Coverage Δ
abcclassroom/tests/test_git.py 99.21% <99.07%> (-0.79%) ⬇️
abcclassroom/git.py 82.00% <100.00%> (+36.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f680b89...8059dd6. Read the comment docs.

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