Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnitTest: Make the console cmd Dev::UnitTest::Run a frontend for TAP::Harness #192

Closed
bschmalhofer opened this issue Jul 11, 2020 · 10 comments
Assignees
Labels
question Further information is requested
Milestone

Comments

@bschmalhofer
Copy link
Contributor

bschmalhofer commented Jul 11, 2020

As prove -I . -I Kernel\cpan-lib -r scripts/testis now working, the console command command can be converted to doing the same thing as prove. The important features should be preserved. Unused features should be removed.

Internally Kernel::System::UnitTest::Drivercould changed to be a proper Test2 testing tool. See https://metacpan.org/pod/Test2::Manual::Tooling . This should be safe for all the encoding issues, because the question whether ùse utf8`is active is then solely determined by the test script itself.

Switching to App::Provewould also allow to remove the funny 1; in the last line of the test scripts.

@bschmalhofer bschmalhofer added the enhancement New feature or request label Jul 11, 2020
@bschmalhofer bschmalhofer added this to the OTOBO 10.1 milestone Jul 11, 2020
@bschmalhofer bschmalhofer self-assigned this Jul 11, 2020
@svenoe
Copy link
Contributor

svenoe commented Jul 11, 2020

First we have to discuss the pros and cons of this!! ;)

@bschmalhofer
Copy link
Contributor Author

I'll change the label to 'question'.

@bschmalhofer bschmalhofer added question Further information is requested and removed enhancement New feature or request labels Jul 11, 2020
@bschmalhofer
Copy link
Contributor Author

This change would also allow the use of Test2::V0 and Test::Builder.

@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Sep 22, 2020

During the September meeting of the OTOBO Team it was decided that the continous integration features of Dev::UnitTest::Run are no longer supported. These features can be removed. Concretely the following options can be removed:

  • --submit-url
  • --submit-auth
  • --submit-result-as-exit-code
  • --job-id
  • --scenario
  • --attachment-path
  • --pre-submit-script

The reason is that the infrastructure for managing these submissions do not exist for OTOBO. New infrastructure might be based on Github actions or on https://metacpan.org/release/Tapper. But that will be a different issue.

@bschmalhofer
Copy link
Contributor Author

The relevant module is actually TAP::Harness, not App::Prove. App::Prove uses TAP::Harness.

bschmalhofer added a commit that referenced this issue Sep 22, 2020
Options that were used for submitting test reports
bschmalhofer added a commit that referenced this issue Sep 22, 2020
bschmalhofer added a commit that referenced this issue Sep 22, 2020
This is more in line with TAP::Harness.
Also a bit of tidying.
@bschmalhofer bschmalhofer changed the title UnitTest: Make the console cmd Dev::UnitTest::Run a frontend for App::Prove UnitTest: Make the console cmd Dev::UnitTest::Run a frontend for TAP::Harness Sep 23, 2020
@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Sep 23, 2020

The option --test-runs can also be added again when it is found to be useful.

The same applies to the option --data-diff-type. Supporting this option is hard because the driver instance is now created by the script itself. So, for now, let's stick with the default diff type table.

@bschmalhofer
Copy link
Contributor Author

The Selenium screenshot feature will be disabled for now as well.

bschmalhofer added a commit that referenced this issue Sep 23, 2020
minor code fiddling, hopefully improvements
bschmalhofer added a commit that referenced this issue Sep 23, 2020
bschmalhofer added a commit that referenced this issue Sep 23, 2020
Otherwise remove support for coloring
bschmalhofer added a commit that referenced this issue Sep 23, 2020
add a OTOBO specific output line, just because tradition
bschmalhofer added a commit that referenced this issue Sep 23, 2020
bschmalhofer added a commit that referenced this issue Sep 23, 2020
Not succeeding, the test 'ok s' are still passed to TAP::Harness
bschmalhofer added a commit that referenced this issue Sep 23, 2020
when loading Kernel::System::UnitTest::RegisterDriver
@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Sep 23, 2020

The migration seems to work mostly. One failure is UnitTest/Blacklist.t, It looks like STDOUT from

$ExitCode = $CommandObject->Execute( '--test', $Test->{Test} );
is not captured in Blacklist.t. Strange.

@bschmalhofer
Copy link
Contributor Author

bschmalhofer commented Sep 25, 2020

Let's create a branch based on rel-10_0 that backports these adaptions to the test suite. Based on the result of test runs we can decide whether these adaption can be included in 10.0.4. The actual backport will be done in #447 .

bschmalhofer added a commit that referenced this issue Sep 25, 2020
Understandably the module would not load when misspelled
bschmalhofer added a commit that referenced this issue Sep 25, 2020
while STDOUT is still redirected to a Perl scalar
bschmalhofer added a commit that referenced this issue Sep 25, 2020
Just to have a really simple testscript.
bschmalhofer added a commit that referenced this issue Sep 25, 2020
But the test output from NutsAndBolts.t is still visible
@bschmalhofer
Copy link
Contributor Author

Tests look fine:

161021 Test Summary Report
161022 -------------------
161023 /opt/otobo/scripts/test/UnitTest/Blacklist.t                                                              (Wstat: 0 Tests: 3 Failed: 1)
161024   Failed test:  2
161025   Parse errors: More than one plan found in TAP output
161026                 Tests out of sequence.  Found (1) but expected (2)
161027                 Tests out of sequence.  Found (2) but expected (3)
161028                 Bad plan.  You planned 2 tests but ran 3.
161029 Files=949, Tests=56381, 1775 wallclock secs ( 7.87 usr  2.00 sys + 1106.61 cusr 122.07 csys = 1238.55 CPU)
161030 Result: FAIL
161031 ran tests for product OTOBO 10.1.x on yourhost.example.com

The issue with UnitTest/Blacklist.t is handled in #472 . Closing this issue. Further problems should be handled in dedicated issues.

bschmalhofer added a commit that referenced this issue Sep 28, 2020
Running internal tests messed up the test counter, see #192
bschmalhofer added a commit that referenced this issue Sep 28, 2020
Because there were issues with the localised STDOUT, see #192
@bschmalhofer bschmalhofer modified the milestones: OTOBO 10.1, OTOBO 10.1.1 Nov 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants