Repository navigation
Use UTC timezone - #569
Use UTC timezone#569
Conversation
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @aneeshusa (or someone else) soon. |
|
Looks like timezone is not supported for macOS : saltstack/salt#31345 |
aneeshusa
left a comment
There was a problem hiding this comment.
Looks pretty good! Another change - in .travis.yml, each builder that invokes the test suite should get language: python and python: 3.5.
| if [[ "${SALT_NODE_ID}" == "servo-master1" ]]; then | ||
| ./test.py sls.buildbot.master sls.homu sls.nginx | ||
| fi | ||
| ./test.py sls.common |
There was a problem hiding this comment.
We should only run this on the non-macOS machines for now, so we can check the ${SALT_NODE_ID} isn't a macOS node; easiest way is probably using the =~ bash operator.
| - shell: /bin/bash | ||
| - home: {{ common.servo_home }} | ||
|
|
||
| UTC: |
There was a problem hiding this comment.
Use Jinja to render this state conditionally, only on non-macOS, using an {% if ... %} block.
|
|
||
| def run(): | ||
| command = 'date' | ||
| ret = subprocess.run(command, |
There was a problem hiding this comment.
Inline the command and pass as an array so we control word-splitting, etc.
subprocess.run(['date'], ...)
There was a problem hiding this comment.
Also, prefer to use block indent:
ret = subprocess.run(
['date'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
73a8df0 to
4d60976
Compare
aneeshusa
left a comment
There was a problem hiding this comment.
One last nit, everything else LGTM, so go ahead and squash while addressing this last comment.
|
|
||
| # Salt doesn't support timezone.system on OSX | ||
| # See https://github.com/saltstack/salt/issues/31345 | ||
| if [[ "${TRAVIS_OS_NAME}" != "osx" ]]; then |
There was a problem hiding this comment.
In the future the list of tests to run will be auto-generated from the Salt top file, so I'd prefer to check ${SALT_NODE_ID} instead of ${TRAVIS_OS_NAME}. You can use e.g.
if [[ ! "${SALT_NODE_ID}" =~ servo-mac* ]]; then
...
fi
There was a problem hiding this comment.
Sorry about that. I thought it would be less error-prone (because the servo-mac* could change at some point) but if it needs to be travis independant I totally get that.
aneeshusa
left a comment
There was a problem hiding this comment.
Thought of an optional enhancement for bonus points, or else you can squash the current commits which LGTM.
| stdout = ret.stdout.decode('utf-8') | ||
|
|
||
| if ret.returncode == 0 and 'UTC' in stdout: | ||
| return Success('Date is in UTC') |
There was a problem hiding this comment.
I was reading an article about testing yesterday which reminded me of expected-failure tests, which is IMO a nicer way to handle the macOS situtation. Roughly, instead of just returning Success here, use sys.platform to check if we're on macOS, and if so, return Failure in that case with an appropriate message; and vice-versa for the Failure. This inverts the expectations and lets us run the sls.common test unconditionally.
Note that in the .travis.yml file, I believe python isn't supported on macOS, so don't update those entries to add the python3.5 spec. However, we may need to install Python 3.5 manually with brew on the OS X builders; make a separate commit and see if it's necessary before adding that.
It may be a little tricky to add so I'll make it optional, for bonus points :)
There was a problem hiding this comment.
Should I put the brew python install inside a saltscript or inside the .travis/install...sh ?
There was a problem hiding this comment.
Let's not add the brew install unless the test suite fails to run on macOS on Travis (i.e. check first), but if we need it I'd probably put it in the dispatch script before we print the Python version.
|
If you go for the bonus points, in the |
83f74e2 to
c2f2054
Compare
|
I believe installing Python 3.5 on the Mac builders actually takes a bit of time, so let's skip the xfail stuff for now. Everything else looked good, so discard the last commit and squash the first five, and we'll get this landed. |
|
Also, please rebase on top of the latest master to pull in #573. |
|
Thanks for the patch @charlesvdv! @bors-servo r+ |
|
📌 Commit 751f12e has been approved by |
|
⚡ Test exempted - status |
Use UTC timezone Fix the issue #303 and follow up of #439 PR. I'm not sure about the spot to put the ```sls.common``` tests. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/saltfs/569) <!-- Reviewable:end -->
Fix the issue #303 and follow up of #439 PR.
I'm not sure about the spot to put the
sls.commontests.This change is