Closed Bug 1042858 Opened 8 years ago Closed 7 years ago

Remove unit tests template from minified JS

Categories

(Marketplace Graveyard :: Consumer Pages, defect, P5)

defect

Tracking

(Not tracked)

RESOLVED FIXED
2015-03-17

People

(Reporter: cvan, Assigned: koddsson)

References

Details

(Whiteboard: [good first bug][repoman][qa-])

https://marketplace.cdn.mozilla.net/media/fireplace/js/include.js?b=1406052479313 contains the source to `templates/tests.html`:

    ,e["tests.html"]=function(){function e(e,t,n,r,o){var a=null,i=null,s="";try{s+='<section class="main infobox">\n<div>\n<h2>Unit Tests</h2>\n<progress value="0"></progress>\n<table>\n<tr>\n<th>Started</th>\n<th>Passed</th>\n<th>Failed</th>\n</tr>\n<tr>\n<td id="c_started">0</td>\n<td id="c_passed">0</td>\n<td id="c_failed">0</td>\n</tr>\n</table>\n<ol class="tests"></ol>\n</div>\n</section>\n<script type="text/javascript" src="/tests/apps.js"></script>\n<script type="text/javascript" src="/tests/cache.js"></script>\n<script type="text/javascript" src="/tests/l10n.js"></script>\n<script type="text/javascript" src="/tests/mobilenetwork.js"></script>\n<script type="text/javascript" src="/tests/navigation.js"></script>\n<script type="text/javascript" src="/tests/models.js"></script>\n<script type="text/javascript" src="/tests/requests.js"></script>\n<script type="text/javascript" src="/tests/rewriters.js"></script>\n<script type="text/javascript" src="/tests/urls.js"></script>\n<script type="text/javascript" src="/tests/utils.js"></script>',o(null,s)}catch(l){o(r.handleError(l,a,i))}}return{root:e}}()

We don't need this in our minified source.
Blocks: 990316
Priority: -- → P5
Whiteboard: [repoman] [contribute]
Whiteboard: [repoman] [contribute] → [good first bug][repoman]
Hi Christopher, can you guide me to resole this bug?
Flags: needinfo?(cvan)
Hi Wil, any updates?
Flags: needinfo?(wclouser)
Hi Trishul,

Apologies for the delayed response. The docs for the frontend code are here:

    http://marketplace-frontend.readthedocs.org/

The code that includes the `tests/` AMD modules is here:

    https://github.com/mozilla/fireplace/blob/723eba8a/src/media/js/routes.js#L69

There's a Gulp task that gets runs during our deploys (`gulp build`, which calls `gulp js_build`):

    https://github.com/mozilla/marketplace-gulp/blob/7fbedbf1/index.js#L399-L400
    https://github.com/mozilla/marketplace-gulp/blob/7fbedbf1/index.js#L269-L271

And this is the line where the JS paths are included for the optimised, minified JS bundle:

    https://github.com/mozilla/marketplace-gulp/blob/7fbedbf1/index.js#L256

Fellow Marketplace developer, Kevin Ngo, has a good understanding of the architecture here. And I would follow up with him if you have any questions.
Flags: needinfo?(wclouser)
Flags: needinfo?(cvan)
HI Christopher,
I think I need a bit more understanding of the marketplace frontend architecture. 
Also about gulp tasks.

Thanks.
Flags: needinfo?(kngo)
Flags: needinfo?(cvan)
I hope nobody minds that I made a PR on github to fix this => https://github.com/mozilla/marketplace-gulp/pull/13
Hey Kristjan, you can resolve this bug by removing src/templates/tests.html from mozilla/fireplace :)
Flags: needinfo?(koddsson)
Flags: needinfo?(kngo)
Flags: needinfo?(cvan)
Made another PR => https://github.com/mozilla/fireplace/pull/1074
Flags: needinfo?(koddsson)
https://github.com/mozilla/fireplace/pull/1074
Assignee: nobody → koddsson
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Whiteboard: [good first bug][repoman] → [good first bug][repoman][qa-]
Target Milestone: --- → 2015-03-17
You need to log in before you can comment on or make changes to this bug.