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

Better timestamps in builds #42958

Merged
merged 2 commits into from
Jun 29, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,22 @@ before_script:
if [[ "$SKIP_BUILD" == true ]]; then
export RUN_SCRIPT="echo 'skipping, not a full build'";
else
RUN_SCRIPT="stamp src/ci/init_repo.sh . $HOME/rustsrc";
RUN_SCRIPT="src/ci/init_repo.sh . $HOME/rustsrc";
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
export RUN_SCRIPT="$RUN_SCRIPT && stamp src/ci/run.sh";
export RUN_SCRIPT="$RUN_SCRIPT && src/ci/run.sh";
else
export RUN_SCRIPT="$RUN_SCRIPT && stamp src/ci/docker/run.sh $IMAGE";
export RUN_SCRIPT="$RUN_SCRIPT && src/ci/docker/run.sh $IMAGE";
fi
fi

# Log time information from this machine and an external machine for insight into possible
# clock drift. Timezones don't matter since relative deltas give all the necessary info.
script:
- sh -x -c "$RUN_SCRIPT"
- >
date && curl -s --head https://google.com | grep ^Date: | sed 's/Date: //g'
- stamp sh -x -c "$RUN_SCRIPT"
- >
date && curl -s --head https://google.com | grep ^Date: | sed 's/Date: //g'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be good to have a comment here explaining this. I'd also like to note that comparing these two may be hard because of timezones (maybe there's something we can pass to date?).

I also think it may be worth printing this once before we run the script and afterwards -- that way we if we do find a problem, we know whether it happened during the build.

$ date && curl -s --head https://google.com | grep ^Date: | sed 's/Date: //g'
Wed Jun 28 16:24:07 MDT 2017
Wed, 28 Jun 2017 22:24:07 GMT

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a comment, also justifying why timezones don't matter (relative differences give all the info we need).

I'm not confused by you suggesting printing before the script and afterwards - that's what it currently does, per the identical lines above and below the stamp line?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes I missed that it already logs before and after. Looks good to me, thanks for doing this!


after_success:
- >
Expand Down