test(unit): workaround for function definition in command offset test#1312
Draft
inconstante wants to merge 1 commit intoscop:mainfrom
Draft
test(unit): workaround for function definition in command offset test#1312inconstante wants to merge 1 commit intoscop:mainfrom
inconstante wants to merge 1 commit intoscop:mainfrom
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.
Collaborator
|
I think I have a related branch in my fork repository. Do you think this is fixed by 409ec8a? |
Contributor
Author
I doesn't. Also, it looks like this commit breaks another test (test_1) in the same file: |
Collaborator
|
OK, thanks for trying. I haven't actually tested that branch. I'll later take a look at it. |
Contributor
Author
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. |
Contributor
Author
|
The branch has the same issue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.