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

conversions_test and crw_test fail in CI/msvc #1300

Closed
clanmills opened this issue Sep 12, 2020 · 3 comments
Closed

conversions_test and crw_test fail in CI/msvc #1300

clanmills opened this issue Sep 12, 2020 · 3 comments
Assignees
Labels
Milestone

Comments

@clanmills
Copy link
Collaborator

A couple of the new python tests/bash_tests are failing on the CI. The fix is to set TZ=GMT-8 in the environment:

======================================================================
1220ERROR: conversions_test (bash_tests.testcases.TestCases)
1221----------------------------------------------------------------------
1222Traceback (most recent call last):
1223  File "C:\projects\exiv2-wutfp\tests\bash_tests\testcases.py", line 243, in conversions_test
1224    BT.reportTest('conversions', out)
1225  File "C:\projects\exiv2-wutfp\tests\bash_tests\utils.py", line 491, in reportTest
1226    raise RuntimeError('\n' + log.to_str())
1227RuntimeError: 
1228[INFO] #1 Convert Exif ImageDescription to XMP x-default langAlt value
1229[INFO] #2 Convert XMP x-default langAlt value back to Exif ImageDescription
1230[INFO] #3 Convert XMP single non-x-default langAlt value to Exif ImageDescription
1231[INFO] #4 This shouldn't work: No x-default, more than one language
1232[INFO] #5 Add a default language to the XMP file and convert to Exif and IPTC
1233[INFO] #6 Convert an Exif user comment to XMP
1234[INFO] #7 And back to Exif
1235[INFO] #8 Convert IPTC keywords to XMP
1236[INFO] #9 And back to IPTC
1237[INFO] #10 Convert an Exif tag to an XMP text value
1238[INFO] #11 And back to Exif
1239[INFO] #12 Convert an IPTC dataset to an XMP text value
1240[INFO] #13 And back to IPTC
1241[INFO] #14 Convert a few other tags of interest from Exif/IPTC to XMP
1242[INFO] #15 And back to Exif/IPTC
1243[INFO] #16 https://github.com/Exiv2/exiv2/issues/521
1244[ERROR] The output of the testcase mismatch the reference
1245[INFO] The output has been saved to file C:\projects\exiv2-wutfp\test\tmp\conversions.out
1246[INFO] simply_diff:
1247C:\projects\exiv2-wutfp\test\data\conversions.out: 204 lines
1248C:\projects\exiv2-wutfp\test\tmp\conversions.out: 204 lines
1249The first mismatch is in line 165:
1250< Exif.Image.DateTime                          Ascii      20  2015:04:18 02:10:22
1251> Exif.Image.DateTime                          Ascii      20  2015:04:17 18:10:22
1252
1253======================================================================
1254ERROR: crw_test (bash_tests.testcases.TestCases)
1255----------------------------------------------------------------------
1256Traceback (most recent call last):
1257  File "C:\projects\exiv2-wutfp\tests\bash_tests\testcases.py", line 279, in crw_test
1258    BT.reportTest('crw-test', out)
1259  File "C:\projects\exiv2-wutfp\tests\bash_tests\utils.py", line 491, in reportTest
1260    raise RuntimeError('\n' + log.to_str())
1261RuntimeError: 
1262[INFO] #1 Add and modify tags
1263[INFO] #2 Delete tags
1264[ERROR] The output of the testcase mismatch the reference
1265[INFO] The output has been saved to file C:\projects\exiv2-wutfp\test\tmp\crw-test.out
1266[INFO] simply_diff:
1267C:\projects\exiv2-wutfp\test\data\crw-test.out: 250 lines
1268C:\projects\exiv2-wutfp\test\tmp\crw-test.out: 250 lines
1269The first mismatch is in line 9:
1270< Exif.Photo.DateTimeOriginal                  Ascii      20  2005:04:23 18:54:36
1271> Exif.Photo.DateTimeOriginal                  Ascii      20  2005:04:23 17:54:36
1272
1273----------------------------------------------------------------------
1274Ran 193 tests in 16.388s
1275
C:\Users\rmills\gnu\github\exiv2\0.27-maintenance\build>git diff
diff --git a/tests/bash_tests/utils.py b/tests/bash_tests/utils.py
index 6a3005a1..d5746096 100644
--- a/tests/bash_tests/utils.py
+++ b/tests/bash_tests/utils.py
@@ -410,7 +410,9 @@ class Executer:

         # Execute the command in subprocess
         try:
-            with subprocess.Popen(self.args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=stderr, cwd=self.cwd) as self.subprocess:
+            my_env = os.environ.copy()
+            my_env['TZ'] = 'GMT-8'
+            with subprocess.Popen(self.args,env=my_env, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=stderr, cwd=self.cwd) as self.subprocess:
                 try:
                     output  = self.subprocess.communicate(self.stdin, timeout=10)  # Assign (stdout, stderr) to output
                 except subprocess.TimeoutExpired:

C:\Users\rmills\gnu\github\exiv2\0.27-maintenance\build>
@clanmills clanmills added the bug label Sep 12, 2020
@clanmills clanmills added this to the v0.27.4 milestone Sep 12, 2020
@LeoHsiao1
Copy link
Contributor

Is it convenient to set environment variables?
Do you want to just replace the string?

str.replace('17:54:36', '18:54:36')

@clanmills
Copy link
Collaborator Author

I'm not sure. For sure there's TZ magic here. And I've hacked this in the past:

1433 rmills@rmillsmbp:~/gnu/github/exiv2/0.27-maintenance/build $ grep TZ ../test/*.sh ../test/*.source
../test/conversions.sh:    TZ=GMT-8 runTest exiv2 -iX v.jpg
../test/crw-test.sh:) 2>&1 | sed -e 's#19:54#18:54#g' > $results   # sed evades TZ issue on MSVC builds #1221
../test/functions.source:    export TZ=BST-1
1434 rmills@rmillsmbp:~/gnu/github/exiv2/0.27-maintenance/build $ 

Relax! We'll find and fix everything.

clanmills added a commit that referenced this issue Sep 13, 2020
@clanmills
Copy link
Collaborator Author

Fixed with f483ed0 and submitted in #1296

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants