bagit-java
bagit-java copied to clipboard
BagLinterTest fails under MacOs
Given
- bagit-java 5.0.4
- MacOs High Sierra 10.13.2
When
- I build with tests under MacOs
Then
- BagLinterTest fails in line 43: assertEquals("Warnings missing: " + diff.toString() + "\n", expectedWarnings, warnings);
Obviously, removing BagitWarning.DIFFERENT_NORMALIZATION from the list of expected warnings is not longer necessary.
I also run MacOs High Sierra 10.13.2 and it does not fail for me. How is your hard drive formatted? Mine is APFS (Encrypted)
Indeed, this is strange. I'm using APFS (Unencrypted), too. Currently, I'm encrypting my filesystem to see if this has any influence, but I don't think so. Maybe the German system language causes this issue?
I've played around a bit with ManifestChecker#checkNormalization and I found out, that during BagLintTest#testLintBag 'src/test/resources/linterTestBag/data/Núñez' is normalized to 'src/test/resources/linterTestBag/data/Nu´n~ez' unless I'm using Normalizer.Form.NFC
Edit: Are you sure that your hard drive is APFS formatted and not HFS+, maybe your source code directory is on a separate disk? In this issue https://github.com/vgough/encfs/issues/316 there is a comment on how to check for NFD or NFC from 5 May 2017 and in my case, the NFD normalized form applies.
Edit2:
Ok, it seems that the different behaviour is indeed caused by the German locale settings. Obviously, NFD as well as NFC normalization have to be supported somehow.
Do you still get this error if you change the Locale
to english in the test?
Changing the locale in the code doesn't change anything. Also changing the system language to English has no influence. According to this article it seems that this issue is related to APFS and indeed, the colleague running her iMac with an English Locale is still not using High Sierra and therefore also no APFS but HFS+. However, the fact that the tests are succeeding on your machine running APFS is now even more confusing.
What is the output from the diskutil
? Mine is
diskutil info /
Device Identifier: disk1s1
Device Node: /dev/disk1s1
Whole: No
Part of Whole: disk1
Volume Name: Macintosh HD
Mounted: Yes
Mount Point: /
Partition Type: 41504653-0000-11AA-AA11-00306543ECAC
File System Personality: APFS
Type (Bundle): apfs
Name (User Visible): APFS
Owners: Enabled
OS Can Be Installed: Yes
Booter Disk: disk1s2
Recovery Disk: disk1s3
Media Type: Generic
Protocol: PCI
SMART Status: Not Supported
Volume UUID: D3DE8A4A-DD48-3064-84F8-01019B0A7E68
Disk / Partition UUID: D3DE8A4A-DD48-3064-84F8-01019B0A7E68
Disk Size: 500.1 GB (500068036608 Bytes) (exactly 976695384 512-Byte-Units)
Device Block Size: 4096 Bytes
Volume Total Space: 500.1 GB (500068036608 Bytes) (exactly 976695384 512-Byte-Units)
Volume Used Space: 307.0 GB (307038670848 Bytes) (exactly 599684904 512-Byte-Units) (61.4%)
Volume Available Space: 193.0 GB (193029365760 Bytes) (exactly 377010480 512-Byte-Units) (38.6%)
Allocation Block Size: 4096 Bytes
Read-Only Media: No
Read-Only Volume: No
Device Location: Internal
Removable Media: Fixed
Solid State: Yes
For me this looks quite similar:
Device Identifier: disk1s1
Device Node: /dev/disk1s1
Whole: No
Part of Whole: disk1
Volume Name: Macintosh HD
Mounted: Yes
Mount Point: /
Partition Type: 41504653-0000-11AA-AA11-00306543ECAC
File System Personality: APFS
Type (Bundle): apfs
Name (User Visible): APFS
Owners: Enabled
OS Can Be Installed: Yes
Booter Disk: disk1s2
Recovery Disk: disk1s3
Media Type: Generic
Protocol: PCI
SMART Status: Not Supported
Volume UUID: 8A462F06-62F8-3520-BCAE-0F7146B1DCB9
Disk / Partition UUID: 8A462F06-62F8-3520-BCAE-0F7146B1DCB9
Disk Size: 436.0 GB (435969568768 Bytes) (exactly 851503064 512-Byte-Units)
Device Block Size: 4096 Bytes
Volume Total Space: 436.0 GB (435969568768 Bytes) (exactly 851503064 512-Byte-Units)
Volume Used Space: 311.1 GB (311056560128 Bytes) (exactly 607532344 512-Byte-Units) (71.3%)
Volume Available Space: 124.9 GB (124913008640 Bytes) (exactly 243970720 512-Byte-Units) (28.7%)
Allocation Block Size: 4096 Bytes
Read-Only Media: No
Read-Only Volume: No
Device Location: Internal
Removable Media: Fixed
Solid State: Yes
Device Location: "SSD"
Yeah doing a diff, the only difference is the size and UUIDs. I am running on a old macbook air, so I have upgraded several times. Did you always have APFS, or like me did you upgrade?
I'm not totally sure, but I think that I've upgraded it with macOS High Sierra.