Closed Bug 1072842 Opened 10 years ago Closed 9 years ago

Add TRY_ENV=1 for unit/integration test of gaia build system (Gbu/Gb)

Categories

(Release Engineering :: Applications: MozharnessCore, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: yurenju, Assigned: rickychien)

References

Details

Attachments

(1 file)

we will add Add BUILD_TEST_MANIFEST for setting blacklist for integration test of gaia build system, that can help us to skip some test which should not run on try server like gaia-node-modules test.

this change should be pretty easy, just an add environment variable:
> BUILD_TEST_MANIFEST=build/test/resources/tbpl-manifest.json
The approach to disable network connections for Gbu/Gb has been changed. Instead of adding BUILD_TEST_MANIFEST, I decided to skip network-required tests by "mocha --invert --grep (-ig)" filter.
Build system will receive "TRY_ENV=1" to disable all network-required tests. 

Just add an environment variable:

TRY_ENV=1

before launching "make build-test-unit" / "make build-test-integration".
Summary: Add BUILD_TEST_MANIFEST for integration test of gaia build system (Gb) → Add TRY_ENV=1 for unit/integration test of gaia build system (Gbu/Gb)
Hi Jordan Lund,

Could you help me to add TRY_ENV=1 as comment 1 mentioned? Thanks:)
Flags: needinfo?(jlund)
Blocks: 1059449
(In reply to Ricky Chien [:rickychien] from comment #2)
> Hi Jordan Lund,
> 
> Could you help me to add TRY_ENV=1 as comment 1 mentioned? Thanks:)

I took a quick look. It appears like we already declare a few env vars at those make calls. We could add TRY_ENV=1 to these commands[1][2]. That would be the simplest and would work *if* you want to introduce this env var every time you run gbu/gb.

to test this, you can run these tests on try with your own mozharness. IIUC you could do something like:
    1) clone mozharness and push your changes to a mozharness user repo
    2) a patch like this (pointing to your hg user repo with changes): https://hg.mozilla.org/try/diff/e2dddcfda2b9/testing/mozharness/mozharness.json
    3) try commit msg like: 'try: -b d -p linux64 -u gaia-build,gaia-build-unit -t none'

does this help? :)

[1] http://mxr.mozilla.org/build/source/mozharness/scripts/gaia_build_unit.py#36
[2] http://mxr.mozilla.org/build/source/mozharness/scripts/gaia_build_integration.py#36
Flags: needinfo?(jlund)
Thanks for your help!

I've successfully disabled build/test/integration/node_modules_test.js on treeherder [1] and Gb was green!

I'm sure TRY_ENV=1 has populated into Gb log [2].

How can I submit this patch to mozharness? Do I set review? flag to you? (I neither have an experience in patching mozharness and nor familiar with submitting mercurial patch procedures)

[1] https://treeherder.mozilla.org/#/jobs?repo=try&revision=ec2d8136d3e3&exclusion_state=all
[2] http://ftp.mozilla.org/pub/mozilla.org/b2g/try-builds/ricky060709@gmail.com-ec2d8136d3e3/try-linux64_gecko/try_ubuntu64_vm-b2gdt_test-gaia-build-bm52-tests1-linux64-build328.txt.gz
Flags: needinfo?(jlund)
> I've successfully disabled build/test/integration/node_modules_test.js on
> treeherder [1] and Gb was green!

\o/ do we need to test gbu too?

> 
> How can I submit this patch to mozharness? Do I set review? flag to you?

I normally do all my work in git and then do a

   $ git diff rev_or_branch1 rev_or_branch2 > patch_file.patch

then add that patch file in this bug and request me as the reviewer.

> (I neither have an experience in patching mozharness and nor familiar with
> submitting mercurial patch procedures)

once it is r+ you can land on mozharness hg

   $ hg clone http://hg.mozilla.org/build/mozharness && cd mozharness
   $ hg up -r default -C # make sure you are on the default branch and that is clean from all work
   $ hg import patch_file.patch # diffs from git should apply to hg
   $ (you will be prompted to add a commit message like you would with git)
   $ hg out -p # shows what will be pushed to hg canonical repo
   $ vim .hg/hgrc # add to [path] something like 'mozilla = ssh://hg.mozilla.org/build/mozharness'
     (the important thing is to add the ssh protocol to the remote url so you can push)
   $ hg push mozilla

after that, your changes won't be live until someone from release engineering merges all the patches on default to production.

apologies if that was too verbose. :)
Flags: needinfo?(jlund)
Assignee: nobody → ricky060709
Status: NEW → ASSIGNED
I forgot to say that Gbu was green and TRY_ENV=1 has populated too.
Attached patch Bug1072842.patchSplinter Review
Attachment #8542798 - Flags: review?(jlund)
Comment on attachment 8542798 [details] [diff] [review]
Bug1072842.patch

Review of attachment 8542798 [details] [diff] [review]:
-----------------------------------------------------------------

ship it! :)
Attachment #8542798 - Flags: review?(jlund) → review+
Comment on attachment 8542798 [details] [diff] [review]
Bug1072842.patch

I got:

remote: abort: could not lock repository /repo/hg/mozilla/build/mozharness: Permission denied
abort: unexpected response: empty string

How should I do to get the permission? I'm sure that owner of all files in repo including .hg/ is me. Or could you please me to check in this patch? Set check-in flag to you. Thanks :)
Flags: needinfo?(jlund)
Attachment #8542798 - Flags: checked-in?
Cooper, since Jordan is in PTO, could you help me check-in this patch? Thanks!
Flags: needinfo?(jlund) → needinfo?(coop)
Comment on attachment 8542798 [details] [diff] [review]
Bug1072842.patch

(In reply to Ricky Chien [:rickychien] from comment #9)
> remote: abort: could not lock repository /repo/hg/mozilla/build/mozharness:
> Permission denied
> abort: unexpected response: empty string

This probably means you don't have commit-level access to this repo.

https://hg.mozilla.org/build/mozharness/rev/020094345d6c
Flags: needinfo?(coop)
Attachment #8542798 - Flags: checked-in? → checked-in+
Thanks!
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
thanks coop!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: