Skip to content

Commit

Permalink
Add a regression test for SOURCE_DATE_EPOCH
Browse files Browse the repository at this point in the history
Since bazel 0.10.0 and 0.11.0 were shipped with SOURCE_DATE_EPOCH interpreted
as Kiloseconds rather than seconds since the epoch as it should, extend our test
to also verify that the correct year is shown.

Change-Id: I613d1a967e4e36019b55b720a4b9b7757cfb4b60
PiperOrigin-RevId: 187009490
  • Loading branch information
aehlig authored and Copybara-Service committed Feb 26, 2018
1 parent d6443d2 commit c0e52bc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/test/shell/bazel/bazel_bootstrap_distfile_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function test_bootstrap() {
mkdir -p "${WRKDIR}" || fail "Could not create workdir"
trap "rm -rf \"$WRKDIR\"" EXIT
cd "${WRKDIR}" || fail "Could not change to work directory"
export SOURCE_DATE_EPOCH=1501234567
export SOURCE_DATE_EPOCH=1501234567 # Fri Jul 28 09:36:07 UTC 2017
_log_progress "unzip"
unzip -q "${DISTFILE}"
_log_progress "bootstrap"
Expand All @@ -54,6 +54,9 @@ function test_bootstrap() {
./output/bazel shutdown
_log_progress "assert"
expect_log "${SOURCE_DATE_EPOCH}"
expect_log 2017 # The year 1501234567 seconds since the epoch
expect_not_log 49542 # The year 1501234567000 seconds since the epoch
expect_not_log 1970 # The year 1501234 seconds since the epoch
cd "${olddir}"
_log_progress "done"
}
Expand Down

0 comments on commit c0e52bc

Please sign in to comment.