-
Notifications
You must be signed in to change notification settings - Fork 282
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
Fix exiv2
: verbose extract stdout mutli-file
#2068
Fix exiv2
: verbose extract stdout mutli-file
#2068
Conversation
When using `exiv2 --verbose`, `--extract` with stdout and multiple files, the output is concatenated together.
Codecov Report
@@ Coverage Diff @@
## main #2068 +/- ##
==========================================
- Coverage 61.48% 5.72% -55.77%
==========================================
Files 96 96
Lines 19207 18958 -249
Branches 9843 9845 +2
==========================================
- Hits 11810 1085 -10725
- Misses 5080 17685 +12605
+ Partials 2317 188 -2129
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not use much of the functionality of the exiv2 command line application and I am not the best to judge if that "feature" might have been used by somebody. IMHO it looks like a reasonable thing to limit 👍
Do you really need to add a new .jpg image for the tests? Could you just reuse some other .jpg file from the test/data
folder?
Previously in the
As for image files, I had wondered the same thing. I wasn't sure if it was better for each test to be self contained or if reducing the number of files was better. I am happy to follow the Exiv2 policy. |
I am not sure if we ever discussed about that ... I would say that it makes sense to add new files when it is the only way to check something new. If it is possible to check something with the existing test-data, I would not add more binaries into the repository. |
OK, I will switch the file to an existing one. After this merges, I will try and add a comment somewhere in the documentation to explain the policy. |
@postscript-dev You are the expert in the exiv2 command-line program. I'm sure everybody on Team Exiv2 agrees. I thought there was something in I really like how you used setUp()/open/read to deal with the reference output in #2058. Code can be beautiful. Good Job. |
In both of your points, I had a problem with variables. I tried to use something like:
but it seems that |
I did work on README-TESTS.md. It needs lots more work. Dan's an amazing guy and engineer. For sure, he'll never win a Nobel prize for writing user documentation in English (and neither will I). If there are architecture/structure issues with the test suite and tests/suite.conf, it would good to address them. @1div0 (Peter K) has offered to get more involved with testing. |
@postscript-dev Here's the PR for the work that I started on tests/README-TESTS.md #1553 I'm not asking you to finish this. I know you are already over-loaded. I'm amazed at the work involved in the Nikon/Flash business. I suspect that the handling of environment variables in the test suite is hidden and should be exposed in the python API. For example, a typical test is test_pr_pr_1409.py and has the following code: # -*- coding: utf-8 -*-
import system_tests
class FujiFilm_IFD_Tags_pr1409(metaclass=system_tests.CaseMeta):
url = "https://github.com/Exiv2/exiv2/pull/1409"
filename = "$data_path/exiv2-pr1409.exv"
commands = ["$exiv2 -g Fujifilm $filename"]
stderr = [""]
stdout = ["""Exif.Fujifilm.Version Undefined 4 48 49 51 48
Exif.Fujifilm.SerialNumber Ascii 48 FF0...
...
"""]
retval = [0] The variable stdout[0] = open('$data_path/1234.out','r').read() Python has a library function stdout[0] = open(system_tests.expandvars('$data_path/1234.out'),'r').read() It might even have this. I don't know. If you do the following in the terminal: 1142 rmills@rmillsmm-local:~/gnu/github/exiv2/0.27-maintenance/tests $ python3
Python 3.8.2 (default, Sep 24 2020, 19:37:08)
[Clang 12.0.0 (clang-1200.0.32.21)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import system_tests
>>> help(system_tests) It reports an entry point class SomeName(metaclass=system_tests.CaseMeta):
def setUp(self):
self.commands = [self.expand_variables("$some_var/foo.txt")]
self.stderr = [""]
self.stdout = [self.expand_variables("$success_message")]
self.retval = [0] And I guess that's exactly what you used in #2058. @1div0 and @hassec Can you get involved with #1553 @postscript-dev has done a LOT of work in the last 12 months on the exiv2 man page and many other matters. We can't expect him to take on support, maintenance and development of the test suite. |
@clanmills Yes, for sure I will take a 100k at #1553 and more as the time_t permits. But no ETA yet. Cheers. Best. |
When using
exiv2 --verbose
,--extract
with stdout and multiple files, the output is concatenated together.