Closed martindholmes closed 1 year ago
Working on this in branch issue-234-testPages.
The first problem (broken debug page) turns out to be caused by the fact that the target to generate that page was not being called from most of our targets, including the default one. Fixed that in commit #e495ccc, and also decided that we might as well create this page for end-user builds too, because that provides an instant debug environment for the end-user, or for us if we're asked for help. @joeytakeda do you agree, or should we not do that in this case?
Pull request ready.
First, totally agree that the staticSearch test build should have another page that contains none of the testing scripts, since the test scripts make ad-hoc testing quite difficult.
On creating the debug page for end-users: I'm less inclined to do that since it creates an extra page on their site without the project explicitly asking for it; of course, they could delete it afterwards, but needing to use the debug page seems fairly edge-case to me rather than something that should be turned on by default.
If the search-debug page is there purely to make debugging in the browser easier (rather than testing whether the Closure compiler works), then we might be better off simply providing the sourcemap, if the Closure Compiler in Java is able to create one properly: https://github.com/google/closure-compiler/wiki/Source-Maps. In my experience, the sourcemaps produced by sass, webpack, etc all work perfectly in Chrome and Firefox, but we would have to test to see if Closure does make useful sourcemaps.
Agreed on the source-maps; they work nicely for SASS, but I haven't tried any JS sourcemaps. But we definitely needed an additional page unencumbered by the test run. If you'd like to roll back the inclusion of the search-debug.html page in the non-test targets in the branch, please go ahead.
Will do--and I'll open up a ticket for sourcemaps once I've rolled that back and merged, since that solves this immediate issue.
This appears to be complete; there is now a page called search-manual-debug.html which provides what we need.
Although search-debug.html is created simply by copying the search.html page and replacing the link to ssSearch.js with ssSearch-debug.js, when search-debug.html is opened, the tests fail. That makes it useless for its intended purpose (debugging the test set). Additionally, because both of these search pages have automated tests embedded in them, they're extremely inconvenient for doing other types of test manually, so we should really have a third page using the same index and the ssSearch-debug.js file so that manual testing can easily be done.