k6
k6 copied to clipboard
k6 archive does not produce reproducible archives
Brief summary
Hi,
i'm right now working on a gitops workflow for setting up regular load/performance tests using k6 together with the k6-operator and have stumbled over that k6-archives are hard to compare.
My idea is to check if an archive has changed after building it to check if a change on kubernetes side is necessary or not. So i was trying to sha the archives and compare that checksum.
But sadly the archives are diffing the whole time without any code changes.
Looking at the code of archive i'm expecting that its related to the modtime set here: https://github.com/grafana/k6/blob/master/lib/archive.go#L248C1-L249C1
its now and thus changes the whole time.
maybe this could be set to a fixed value? or at least could this be configurable so reproducible builds are possible?
k6 version
0.50.0
OS
macos
Docker version and image (if applicable)
No response
Steps to reproduce the problem
k6 archive -o test.tar test.js k6 archive -o test2.tar test.js
sha256sum test.tar test2.tar
Expected behaviour
i would expect:
- archives are only diffing if the content has changed
- archives are reproducible
Actual behaviour
sha differs