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

test: fix the GitHub Actions workflow detection test #591

Merged
merged 2 commits into from
Jan 5, 2024

Conversation

behnazh-w
Copy link
Member

This PR fixes a bug in the GitHub Actions workflow detection test. The assertions in the test_get_workflows function were checking the return values of list.sort(), which is an in-place function and doesn't return anything. Instead we should compare the sorted lists.

This PR also removes MacaronTestCase, which is not necessary anymore.

Signed-off-by: behnazh-w <behnaz.hassanshahi@oracle.com>
@behnazh-w behnazh-w requested a review from nathanwn January 5, 2024 02:01
@behnazh-w behnazh-w self-assigned this Jan 5, 2024
@behnazh-w behnazh-w requested a review from tromai as a code owner January 5, 2024 02:01
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 5, 2024
@nathanwn
Copy link
Member

nathanwn commented Jan 5, 2024

I think most test functions in the file are quite repetitive, repeating the same test logic for a few cases within the same test function, and could be refactored into table-driven tests with @pytest.mark.parametrize. However, if you don't think it is super necessary right now and out-of-scope of this PR, we can leave the decision for later. I'd approve the PR then. Let me know.
Otherwise, I don't think there is anything else for this PR.

@behnazh-w
Copy link
Member Author

behnazh-w commented Jan 5, 2024

See commit 9e4bfc9

Signed-off-by: behnazh-w <behnaz.hassanshahi@oracle.com>
@behnazh-w behnazh-w force-pushed the bh/fix-ghaction-test branch from 416179a to 9e4bfc9 Compare January 5, 2024 05:07
Copy link
Member

@nathanwn nathanwn left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the PR.

@behnazh-w behnazh-w merged commit f31e56a into staging Jan 5, 2024
9 checks passed
@behnazh-w behnazh-w deleted the bh/fix-ghaction-test branch January 5, 2024 05:42
art1f1c3R pushed a commit that referenced this pull request Nov 29, 2024
This PR fixes a bug in the GitHub Actions workflow detection test. The assertions in the test_get_workflows function were checking the return values of list.sort(), which is an in-place function and doesn't return anything. Instead we should compare the sorted lists.

This PR also refactors the tests and removes MacaronTestCase, which is not necessary anymore.

Signed-off-by: behnazh-w <behnaz.hassanshahi@oracle.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants