bash_unit icon indicating copy to clipboard operation
bash_unit copied to clipboard

TAP format not valid

Open MichaelBitard opened this issue 8 years ago • 1 comments

The TAP plan is missing at the beginning of the output

See: http://testanything.org/tap-specification.html#the-plan

If you agree with that I can work on a PR.

I need this because the jenkins TAP plugin generate an exception and cant use the report

MichaelBitard avatar Dec 20 '16 13:12 MichaelBitard

In the documentation you are refering to : "The plan is optional"

So I do not consider that bash unit TAP format is invalid. I suggest you open an issue on the jenkins plugin.

In the mean time, could you check if the jenkins plugin would accept TAP output with the plan at the end ?

If this is the case I will consider your PR. But be carefull that bash unit can not (at least not easily) display the plan at the beginning of the TAP output.

This is due to the fact that bash unit sources test file before running tests, hence executing all bash code present in the file before running the tests. This is the way one can perform global setup.

Suppose you run two test suites:

bash_unit test_a test_b

With test_a:

test_a() {
  assert "test -f /tmp/a.tst"
}
rm /tmp/*.tst
touch /tmp/a.tst

And with test_b:

test_b() {
  assert "test -f /tmp/b.tst"
}
rm /tmp/*.tst
touch /tmp/b.tst

bash_unit will first source test_a and run tests inside this file. Then, it will source test_b and run tests inside it. So at the moment bash_unit starts running tests in test_a, it does not know how many tests there are in test_b yet.

As you may guess, sourcing all the test files at first and, then running all the tests of all the file would not work in this exemple.

Hope this comment makes sence.

Regards,

pgrange avatar Dec 21 '16 17:12 pgrange

I trust you're doing great @MichaelBitard.

It's been 8 years, I'm closing this issue.

pgrange avatar Feb 20 '24 16:02 pgrange

I hope you are doing great too @pgrange!

Indeed I never worked on this, sorry ;)

MichaelBitard avatar Feb 23 '24 16:02 MichaelBitard