Skip to content

All MRs that add unit tests conflict with each other #420

Closed

Description

@smcv

To reproduce:

  • Add a feature, write tests for it, and push a MR
  • Add another feature, write tests for it, and push a MR

Expected result: maintainers can review and merge several features in one go

Actual result: each new test has to change the line that prints 1..50, so they all conflict

We could perhaps make this better with code like this?

# in libtest-code.sh

test_number=0

ok () {
    test_number=$(( test_number + 1 )
    echo "ok $test_number - $*"
}

done_testing () {
    echo "1..$test_number"
}
# in the test

reticulate splines
ok "can reticulate splines"

ponder meaning of existence
ok "implements basic philosophy"

done_testing

with the TAP output ending up like this:

ok 1 - can reticulate splines
ok 2 - implements basic philosophy
1..2

Activity

  1. smcv commented on Apr 19, 2021

    @smcv
    CollaboratorAuthor

    (This is the equivalent of ok and done_testing in Perl's Test module, which is where TAP comes from.)

  2. added 2 commits that reference this issue on Oct 1, 2023
    15c8b9c
    1cba871
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions