1

I am running a ct test and my setup is failing, and thus the test suite is skipped.

*** FAILED {test_suite_name_here_SUITE,init_per_suite} ***

My question is how to debug the run of the test suite? And secondly how to get verbose output from the test run which tells me what went wrong.

2240
  • 1,547
  • 2
  • 12
  • 30

1 Answers1

4

You can try to use ct:comment("Output some variable when success ~p", [SomeVar]) and ct:fail("Output some variable when fail ~p", [SomeVar]) - this should helpful for output for success and fail cases. But some time you cannot do it, by reason that something wrong with template of tests, so in this case you need investigate the template what you try to use, for more info you can take a look to awesome online book where you can get a lot of info about Common Tests and not only.

2240
  • 1,547
  • 2
  • 12
  • 30
vkatsuba
  • 1,411
  • 1
  • 7
  • 19
  • 3
    You can also use `ct:pal` and `ct:log`. Those, in case the test fails, will print the output either to the console (`pal`) or the log files (`log`). – Brujo Benavides Oct 02 '19 at 14:33
  • @MaxHeiber first of all your questions is go beyond a little bit of current question with answer. Please, create new question with examples of your tests with code and with your expected result. But short answer is - yes, you can write logs by `lager` about your tests and also use `ct` module for write logs in `html` format for UI/UX visualization, plus the common tests is expected business logic if you will write wrong logic but tests will pass, this will be mean that you need update code of tests with correct logic etc. So, if you can, please, create new question with your code examples. – vkatsuba Sep 04 '20 at 10:25
  • @Viacheslav I was commenting on the wrong question page - deleted the irrelevant comments – Max Heiber Sep 04 '20 at 12:41