AdaCore / e3-core

Core framework for developing portable automated build systems
26 stars 36 forks source link

Fix the SLSA build metadata tests #666

Closed grouigrokon closed 8 months ago

grouigrokon commented 8 months ago

A SLSA predicate object contains run details, which itself contains some build metadata (start and end times).

A BuildMetadata class is thus initialized with two timestamps. Those timestamps are check and transformed to UTC timezone timestamps.

Unfortunately the timezone transformation was erasing the timestamp itself.

By using datetime.astimezone() method (and not datetime.utcnow() anymore), the test failure is fixed. To make sure this does not happen anymore, a time sleep has been added in some tests.

Fixes https://github.com/AdaCore/e3-core/issues/668