Make travis install script clean up the b2g/ and profile/ directories to aid local running

RESOLVED FIXED

Status

P2
normal
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: zcampbell, Assigned: Bebe)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
When running the travis install script locally to replicate Travis environment, a new Gecko is not downloaded if one already exists.

This means we have to delete it manually before running the script.

I suggest we put into the travis install script on gaia a check for b2g/ and/or profile/ directories. If placed conditionally then it shouldn't affect Travis operation, but will make local running easier.
This shouldn't need to be conditional, as these will never be present on Travis so just a rm -rf should work. We may want to prompt the user though if we're about to download a build they don't want.. you can use the $CI environment variable to determine if it's running on Travis. You can see an example of prompting the user here: https://github.com/mozilla/mozmill-ci/blob/a118030f2d42e4f1453ee2f9f595c4f15abda78e/run_tests.sh#L14
(Reporter)

Comment 2

5 years ago
OK that's easy.
I think executing the script is indication enough of the user's intention to delete it and re-download another one. It's a travis script, denoted by being in that directory, not a local download script.
(Reporter)

Updated

5 years ago
Priority: -- → P2
(Assignee)

Updated

5 years ago
Assignee: nobody → florin.strugariu
(Assignee)

Comment 3

5 years ago
Created attachment 8386804 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/16958
Attachment #8386804 - Flags: review?(zcampbell)
Attachment #8386804 - Flags: review?(dave.hunt)
(Reporter)

Comment 4

5 years ago
Comment on attachment 8386804 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/16958

r+
Attachment #8386804 - Flags: review?(zcampbell) → review+
Comment on attachment 8386804 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/16958

Inconsistency is one of my pet hates, which explains my nit picking in the pull request. Feel free to ignore it and I'll pretend I never saw it. :)

I don't know who's using this script, but if they want to run it against a custom build they won't be able to with this patch as it will be deleted every time. I think it's worth checking with the gaia dev team to see if that's a concern. The download is quite large, so downloading it every time might cause users with slow connections some pain too.

Why not just add a prompt as suggested in comment 1? It's trivial, and can be easily skipped on Travis or even locally by setting an environment variable, or by having an optional argument.
Attachment #8386804 - Flags: review?(dave.hunt) → review-
(Reporter)

Comment 6

5 years ago
Dave, this is the install script and there is a separate script for actually running the tests, so you generally run this once for your particular gecko/gaia combination and the run test runner script several times.

tbh now I think it would be more important to just delete the Gaia profile than both. the profile is far more sensitive to changes than Gecko. But if you were not aware of how this script behaved (now) you could end up running both these scripts you could easily mismatch a gecko and gaia.
(In reply to Zac C (:zac) from comment #6)
> Dave, this is the install script and there is a separate script for actually
> running the tests, so you generally run this once for your particular
> gecko/gaia combination and the run test runner script several times.

Okay, I'll trust your judgement on this one, thanks.

> tbh now I think it would be more important to just delete the Gaia profile
> than both. the profile is far more sensitive to changes than Gecko. But if
> you were not aware of how this script behaved (now) you could end up running
> both these scripts you could easily mismatch a gecko and gaia.

Wouldn't that mean you'll be applying a gaia profile to a potentially rather out of date build? I think if we're deleting one we should probably delete both.
Comment on attachment 8386804 [details] [review]
Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/16958

Changing to r+ based on Zac's comment. Feel free to land with/without the nits addressed.
Attachment #8386804 - Flags: review- → review+
(Reporter)

Comment 9

5 years ago
Yes but then you're back to downloading Gecko again :P
(In reply to Zac C (:zac) from comment #9)
> Yes but then you're back to downloading Gecko again :P

I didn't have an issue with that, so long as the user wants to do it.
(Assignee)

Comment 11

5 years ago
I updated the pull and fixed the nits.
If you guys want I can add the if statement to check for user feedback.

:D
(Reporter)

Comment 12

5 years ago
Merged:
https://github.com/mozilla-b2g/gaia/commit/8280f6749b8183e4bc52ce84affca310858e86d2
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.