teach moz.build about what files get packaged for tests

NEW
Unassigned

Status

4 years ago
9 months ago

People

(Reporter: froydnj, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
We have TEST_HARNESS_FILESnow , we should have TEST_PACKAGED_FILES for removing some of the ad-hoc |stage-package| bits and (eventually) making moz.build understand how to build test packages itself.
I was kind of hoping these would be the same thing, it would suck to have to repeat ourselves. Maybe step 1 would be "stop copying so much crap into _tests"? I think we could probably run most of the test harnesses from the srcdir at this point, and then just do the copying to build the test package. (We'd probably still have to copy all the test files and support files, if for nothing else to handle files that get generated as part of the build.)
(Reporter)

Comment 2

4 years ago
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #1)
> I was kind of hoping these would be the same thing, it would suck to have to
> repeat ourselves. Maybe step 1 would be "stop copying so much crap into
> _tests"? I think we could probably run most of the test harnesses from the
> srcdir at this point, and then just do the copying to build the test
> package.

See, I asked people about this in Portland, and the response was, "wow, that'd be a ton of work." :)
Yeah, I'm pretty sure I gave you that answer, so I don't know what I was thinking in comment 1. I guess I don't understand what the hard problem here is. Can you enlighten me?
(Reporter)

Comment 4

4 years ago
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #3)
> Yeah, I'm pretty sure I gave you that answer, so I don't know what I was
> thinking in comment 1. I guess I don't understand what the hard problem here
> is. Can you enlighten me?

I don't know what the hard parts are here either.  I had a TODO item to look into this, so I went back to this bug, found comment 1, and registered a disconnect.  I'm not sure I understand what "I was kind of hoping these would be the same thing, it would suck to have to repeat ourselves" from comment 1 means?  You hoped we could get to the stage-package: rules from TEST_HARNESS_FILES without having to provide a separate mapping (TEST_PACKAGED_FILES?) between files in _tests/ and where they'd go in the tests package?
Flags: needinfo?(ted)
(In reply to Nathan Froyd (:froydnj) from comment #4)
> I don't know what the hard parts are here either.  I had a TODO item to look
> into this, so I went back to this bug, found comment 1, and registered a
> disconnect.  I'm not sure I understand what "I was kind of hoping these
> would be the same thing, it would suck to have to repeat ourselves" from
> comment 1 means?  You hoped we could get to the stage-package: rules from
> TEST_HARNESS_FILES without having to provide a separate mapping
> (TEST_PACKAGED_FILES?) between files in _tests/ and where they'd go in the
> tests package?

Yes, that's correct. I think right now we have a lot of discrepancy for two reasons:
1) There are some files that test harnesses can use from other places in the objdir but that need to be copied to the test package for things to work in that case. The simplest example I could give is mozinfo.json, which is available in the root of the objdir but gets copied to each test harness directory during test packaging.
2) There are some harnesses that can run from the srcdir (and don't do all the file copying to $objdir/_tests), but still need to get packaged. Reftest is an example of this.

I think for the former we could probably just make $objdir/_tests/whatever become an exact copy of what goes into the test package. That would simplify code paths within test harnesses anyway. For the latter, I don't know, we could add some flag to TEST_HARNESS_FILES to indicate that they don't need the objdir copying, that this is just for packaging?
Flags: needinfo?(ted)

Updated

9 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.