سؤال

I am trying to use TAP(Test Anything Protocol) as our testing result format. However, there are some logs files are needed to attach to test result. I am looking for a good practice to achieve this.

For example, I have a tap file and two log files : a.log, b.log

1..1
ok 1 - sample.MyFirstTest#testCurrentTime
  ---
  message: Hello
  logfile: a.log, b.log
  ...

Is there any good way to insert log file content into this tap file ? Thanks.

هل كانت مفيدة؟

المحلول

Yamlish is the solution. We can embedded file content into tap file. The file content can be encoded as base64, there is a tap example:

1..2
not ok 1
  ---
  Extensions:
    File-Name: test.log
    File-Type: text/plain
    File-Content: VGhpcyBpcyBhIGxvZyAK
  ...
ok 2 # SKIP test 1 failed
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top