Closed Bug 1254374 Opened 4 years ago Closed 4 years ago

Add more failure unit tests to test_configure.py

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(firefox48 fixed)

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(4 files)

test_configure.py mostly tests working conditions. It should also test many kinds of failures. (and the --with-advanced=break test should consequently move to a separate test file)
Blocks: 1256571
Assignee: nobody → mh+mozilla
It now duplicates the test added in bug 1256573, which is actually better.

Review commit: https://reviewboard.mozilla.org/r/45721/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/45721/
Attachment #8740336 - Flags: review?(nalexander)
Attachment #8740337 - Flags: review?(nalexander)
Attachment #8740338 - Flags: review?(nalexander)
Attachment #8740339 - Flags: review?(nalexander)
Comment on attachment 8740336 [details]
MozReview Request: Bug 1254374 - Remove the old TestConfigure.test_imports test. r?nalexander

https://reviewboard.mozilla.org/r/45721/#review42369
Attachment #8740336 - Flags: review?(nalexander) → review+
Attachment #8740337 - Flags: review?(nalexander) → review+
Comment on attachment 8740337 [details]
MozReview Request: Bug 1254374 - Remove TestConfigure.get_result. r?nalexander

https://reviewboard.mozilla.org/r/45723/#review42373
Comment on attachment 8740338 [details]
MozReview Request: Bug 1254374 - Add exception message checks to test_options.py. r?nalexander

https://reviewboard.mozilla.org/r/45725/#review42377

Not a huge fan of repeating plural logic in test assertions, but whatever.  Forward!
Attachment #8740338 - Flags: review?(nalexander) → review+
Comment on attachment 8740339 [details]
MozReview Request: Bug 1254374 - Add various failure tests to test_configure.py. r?nalexander

https://reviewboard.mozilla.org/r/45727/#review42379

Can you give me an example when the representation of type `T` and `T.__name__` differ?

::: python/mozbuild/mozbuild/test/configure/test_configure.py:50
(Diff revision 1)
>          return config
>  
> +    def moz_configure(self, source):
> +        return MockedOpen({
> +            os.path.join(test_data_path,
> +                         'moz.configure'): textwrap.dedent(source)

Nifty.
Attachment #8740339 - Flags: review?(nalexander) → review+
(In reply to Nick Alexander :nalexander from comment #8)
> Comment on attachment 8740339 [details]
> MozReview Request: Bug 1254374 - Add various failure tests to
> test_configure.py. r?nalexander
> 
> https://reviewboard.mozilla.org/r/45727/#review42379
> 
> Can you give me an example when the representation of type `T` and
> `T.__name__` differ?

>>> print type(42)
<type 'int'>
>>> print type(42).__name__
int
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.