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

Tweak how test_last_commit_messages() runs on CI #512

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/unittests/misc/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
IN_CI = 'CI' in os.environ
PUNCTUATION = '.,-_'
TEST_COMMITS = os.environ.get('TEST_SUPERDUPERDB_COMMITS', 't').lower().startswith('t')
COMMIT_MESSAGES_TO_TEST = 10


def _errors(msg):
Expand Down Expand Up @@ -39,16 +40,15 @@ def test_commit_errors():


@pytest.mark.skipif(not TEST_COMMITS, reason='Not testing commit names')
def test_last_commit_names():
def test_last_commit_messages():
# If this test fails, it's because one of your last commit messages was suboptimal!
#
# If you want to skip this test, set an environment variable:
#
# TEST_SUPERDUPERDB_COMMITS=false

commits = git.commits('-10')
if IN_CI:
commits.pop(0)
commits = git.commits(F'-{COMMIT_MESSAGES_TO_TEST + 1}')
commits.pop(0 if IN_CI else -1)

bad_commits = []

Expand Down