reneeb / OPM-Maker

Build and test packages for ticketsystems.
6 stars 7 forks source link

opmbuild filetest ignore path list #9

Closed niccord closed 2 years ago

niccord commented 2 years ago

Hi, as the title suggests, I would like to have a way to tell opmbuild filetest File.sopm to ignore some path.

I thought it could be nice to have something like a .opmbuild-filetest-ignore where it would be possible to specify which relative path ignore, one per line as a .gitignore file.

Cheers!

reneeb commented 2 years ago

This was added in 5c20230d610e56d5c478865d1aefb565a067e9e4 . You can use the .gitignore syntax in a file called .opmbuild_filetest_ignore (has to be a sibling of the .sopm file).

reneeb commented 2 years ago

It should be available on CPAN in a few hours...

niccord commented 2 years ago

Great to hear, thanks!

The tests seem to fail, anyway:

...
t/filetest/01_base.t ......................... ok
t/filetest/02_errors.t ....................... ok
t/filetest/04_subs.t ......................... ok
t/filetest/05_validate_args.t ................ ok
t/filetest/06_max_file_size.t ................ ok
t/filetest_find_sopm/01_base.t ............... ok
test.sopm:1: parser error : Start tag expected, '<' not found
This is a simple plain text file.
^
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 255 just after 1.
t/filetest_find_sopm/02_errors.t ............. 
Dubious, test returned 255 (wstat 65280, 0xff00)
All 1 subtests passed 
t/filetest_find_sopm/05_validate_args.t ...... ok
# 
t/filetest_ignore/02_errors.t ................ ok
t/index/01_base.t ............................ ok
t/index/02_build_index.t ..................... ok
t/index/03_build_otobo_index.t ............... ok
t/index/04_subs.t ............................ ok
t/index/05_validate_args.t ................... ok
t/index/06_index_current_dir.t ............... ok
t/index/07_max_file_size.t ................... ok
t/sopmtest/01_base.t ......................... ok
t/sopmtest/02_errors.t ....................... ok
t/sopmtest/04_subs.t ......................... ok
t/sopmtest/05_validate_args.t ................ ok
t/sopmtest_find_sopm/01_base.t ............... ok
t/sopmtest_find_sopm/05_validate_args.t ...... ok

Test Summary Report
-------------------
t/filetest_find_sopm/02_errors.t           (Wstat: 65280 Tests: 1 Failed: 0)
  Non-zero exit status: 255
  Parse errors: No plan found in TAP output
Files=45, Tests=177,  3 wallclock secs ( 0.08 usr  0.02 sys +  3.44 cusr  0.38 csys =  3.92 CPU)
Result: FAIL
Failed 1/45 test programs. 0/177 subtests failed.
make: *** [Makefile:931: test_dynamic] Error 255

Edit: For some reason, it tests t/invalid/test.sopm instead of t/filetest_ignore/TestSMTP/TestSMTP.sopm

reneeb commented 2 years ago

I added a second feature: You don't have to pass the path of the .sopm if there is one in the current directory, so if you're in /path/to/addon/and there is a addon.sopm, you can run opmbuild filetest and not opmbuild filetest addon.sopm. In the invalid directory there are several .sopm/.opm files and it took the wrong one...

Now (since 048203084a7ade196da2f8fda9a3bc4b360d5a9a) the script fails if you do not pass a filepath and more than one .sopm is found.

Version 1.12 should hit CPAN in a few hours.

niccord commented 2 years ago

The tests are now ok, thanks for your effort!