-
Notifications
You must be signed in to change notification settings - Fork 386
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(unit): workaround for function definition in command offset test #1312
base: main
Are you sure you want to change the base?
Conversation
If the first item in test2 is not executed, for example with the following diff: @@ -55,7 +55,6 @@ class TestUnitCommandOffset: @pytest.mark.parametrize( "cmd,expected_completion", [ - ("cmd2", wordlist), ("cmd3", wordlist), ("cmd4", []), ("cmd5", ["0"]), test_cmd_quoted fails with the following error message: def test_cmd_quoted(self, bash, functions): > assert assert_complete(bash, "meta 'cmd2' ") == self.wordlist E AssertionError: assert <CompletionResult []> == ['bar', 'foo'] E E Full diff: E + <CompletionResult []> E - [ E - 'bar', E - 'foo', E - ] This means that test_cmd_quoted depends on the previous execution of test2. When executed serially, this issue does not manifest itself. However, with parallel execution it might, dependending on the scheduling of the tests. This patch adds a workaround to test_cmd_quoted, so that it executes the required subcommand of test2 prior to its own test.
I think I have a related branch in my fork repository. Do you think this is fixed by 409ec8a? |
I doesn't. Also, it looks like this commit breaks another test (test_1) in the same file:
|
OK, thanks for trying. I haven't actually tested that branch. I'll later take a look at it. |
You're very welcome. By the way, I did not test a branch... I applied you patch on top of master. Maybe I should try your branch instead. |
The branch has the same issue |
In test/t/unit/test_unit_command_offset.py, if the first item in test2 is not executed, for example with the following diff:
test_cmd_quoted fails with the following error message:
This means that test_cmd_quoted depends on the previous execution of test2. When executed serially, this issue does not manifest itself. However, with parallel execution it might, dependending on the scheduling of the tests.
This patch adds a workaround to test_cmd_quoted, so that it executes the required subcommand of test2 prior to its own test.
This is probably not the right fix, thus I'm opening this pull request as draft. I hit a wall and I can't progress, so I'm asking for your help.