This repository has been archived by the owner on Feb 26, 2022. It is now read-only.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
also: * locate all test modules are manifest-generation time, add them as artificial dependencies of api-utils/unit-test-finder * stop including "chrome" as a dependency of each test case * handle "all-test-modules" pseudomodule * handle "packaging" pseudomodule (with data.basePath= URI of caller)
obtained with require("packaging").myURI
* add "packaging" pseudomodule * add non-searching requireURI(uri), for entrypoint and loader * pass basePath into various places * components/harness.js: use loader.requireURI() for entrypoint
hand it to the new loader so searches have a starting point. Also pass in "packaging" so it can get a copy of the manifest. Also includes some debug messages.
this could still be cleaner
Previously test_all_packages() built a fake package that depended upon everything in the packages/ directory. Now it simply runs 'cfx test' over each package, just like test_all_examples() does. This should remove the need for some special-purpose code in, IIRC, test-self and maybe some other "magic" modules. I'm not sure how it might change overall behavior. I do know that packages/development-mode has no tests, so either we need to skip that one or tolerate the 0-of-0 case (and not think that it means failure).
…e search And remove .dirs from the arguments passed into findAndRunTests, removing one consumer of options.rootPaths . Some day we'll be able to get rid of that. All tests pass.
Irakli tells me the functionality tested by this module is no longer relevant to his new loader, so rather than try to rewrite it to avoid doing a runtime search, I'm just getting rid of it. test-file.js is still relevant (it exercises the "file" module), but it was using the old interoperablejs-read-only/ directory as a source of known filenames. I changed it to use modules/ for that purpose instead.
if (!path) | ||
throw new Error('Module "' + moduleName + '" not found'); | ||
moduleData = {uri: path}; | ||
throw new Error("NO SEARCH FOR YOU"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit I think error message can be better than this, like module foo has no privilege to load module bar.
I think it's ready to land! Only one nit. |
I rearranged that part of the code to remove the error message entirely, and to make it more clear that "moduleData" is always passed in. |
warner
pushed a commit
that referenced
this pull request
Oct 26, 2011
Bug 691865: stop doing runtime module search. r=irakli
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@Gozala : this is the cleanup required for your #247 pull request. All tests pass, but I deleted test-securable-module (and the whole tests/interoperablejs-read-only suite) (neither of which passed after my patch) in anticipation of your loader changes.
This branch removes the runtime module search, by doing the following:
linker:
loader:
tests:
Some of this is a bit ugly, but will be cleaned up by Irakli's new loader once it lands, which should be shortly after this one lands.