Commit Graph

76 Commits

Author SHA1 Message Date
Kyle Shankwiler
6803d8dfd1 Add an error message warning developers of oversized headers. (#10877)
* Add an error message warning developers of oversized headers.

An explanation of the issue being logged can be found here: https://forums.meteor.com/t/meteor-1-8-1-unexpected-error-too-many-csp-rules/48447/12.

* Ensure the large request header test works as intended
2020-04-17 11:32:21 -04:00
Christian Klaussner
92013e3486 Remove multiple restart feature (#10345) 2019-12-18 17:56:54 -05:00
Ben Newman
5ed64fb1db Remove explicit .js extension from tools/fs/files imports. 2019-07-04 10:32:09 -04:00
Ben Newman
35ca6980dc Use is-reachable to detect child process health in self-test.
On Linux, child processes that have exited may remain as <defunct>
"zombie" processes, which prevents process.kill(childPid, 0) from
throwing, so we need a different trick for detecting whether the child
process is still alive.
2019-05-02 17:10:41 -04:00
Ben Newman
b0a8e1bfaf Increase arbitrary SIGKILL timeout to make self-test more robust. 2019-05-02 13:44:49 -04:00
Hugh Willson
7c48bb5a73 Prevent Tool crash when settings file contains BOM (#9459)
* Prevent Tool crash when settings file contains BOM

The use of a byte order mark in a `--settings` file
crashes the Meteor Tool, when it attempts to JSON parse
the loaded settings data. Since a BOM is not required
(or recommended) when using UTF-8, this commit removes
it from the loaded settings data, before it is parsed.

Fixes #5180.

* Add PR link to History.md

* Update History.md
2017-12-13 12:05:42 -05:00
David Brown
ed10ede29d Fix error message for invalid ROOT_URL #8026 (#9261) 2017-12-05 10:14:28 -05:00
Hugh Willson
8da6c84eac Update the default CSS parsing/combining/minifying tools (#9263)
* Update the default CSS parsing/combining/minifying tools

The `minifier-css` package is currently using outdated
(and abandoned) npm packages (`css-parse` and `css-stringify`),
as part of its parsing/minification process. This commit
replaces those packages with the robust, modern and maintained
`postcss` package.

* Adjust CSS source file fallback value

* Self test adjustments and cleanup

* Disable sourcesContent generation by postcss

The `standard-minifier-css` package is already associating
source content with the source map, so we don't need to
do this twice.

* Add History.md entry covering backwards compatibility details

* Bump major version due to backwards compatibility breaking changes

* Bump minor versions

* Code review changes (boolean formatting, concat to spread)
2017-11-22 11:13:54 -05:00
Hugh Willson
b498c41401 Avoid creating a watcher when --settings is set to a directory (#9030)
As outlined in #3854, if `meteor --settings` points to a
directory instead of a file, an application gets caught up
in an infinite rebuild loop. Since it was assumed only a
file would be configured via `--settings`, a file watcher
is created for the specified directory, and that watcher
is then triggered ad infinitum.

These changes prevent a file watcher from being created
on a `--settings` directory.
2017-08-21 16:25:15 -04:00
Ben Newman
4dfa9c3ae2 Add METEOR_WATCH_PRIORITIZE_CHANGED=false back to two self-tests. 2017-08-11 15:21:50 -04:00
Ben Newman
837f12c3c4 Add additional timeouts to 'update during run' self-test. 2017-08-11 15:21:50 -04:00
Ben Newman
56aea02723 Stop setting METEOR_WATCH_PRIORITIZE_CHANGED=false in self-tests.
Assuming #9007 fixes the file watcher timing problems, it should no longer
be necessary to disable the optimizations of #8866.
2017-08-11 15:21:50 -04:00
Ben Newman
692602ac46 Set METEOR_WATCH_PRIORITIZE_CHANGED to "false" in "update during run" self-test. 2017-07-10 22:11:33 -04:00
Ben Newman
a5fe404876 Add additional timeouts to "update during run" self-test. 2017-07-10 15:22:51 -04:00
Ben Newman
86eedd4bc6 Make METEOR_WATCH_PRIORITIZE_CHANGED opt-out instead of opt-in.
This restores the behavior of 8c70716954 by
default, with the option of disabling the prioritized file watching system
by setting METEOR_WATCH_PRIORITIZE_CHANGED explicitly to "false".

The self-tests where the environment variable is explicitly set form a
nice to-do list of tests that should be improved to be more robust to cope
with differences in file watcher timing.

Helps with #8648 and similar issues.
2017-07-10 12:31:11 -04:00
Ben Newman
e345fc2d27 Separate failing part of "run --once" test into own test. 2016-11-02 17:07:50 -04:00
Ben Newman
476d6bf7b3 Attempt to fix "run --once" test by giving Mongo a chance to exit.
This test has been failing intermittently on Circle CI.
2016-11-02 16:25:37 -04:00
Ben Newman
dd3fe9a264 Add additional delay to "run: run" test. 2016-09-29 16:03:18 -04:00
Ben Newman
7a530f79f6 Increase more test timeouts for robustness' sake. 2016-07-14 14:52:41 -04:00
Tom Coleman
3b0ae7a903 Rebalanced tests 2016-05-25 17:03:05 -07:00
Tom Coleman
47308da931 Added a test that reproduces logging out of order 2016-05-25 10:54:43 -07:00
Tom Coleman
eadfd1f5b2 Upped timeout for bad PID test 2016-05-24 16:48:43 -07:00
Tom Coleman
c4258d68f1 Marked issues with custom-warehouse tag 2016-05-24 15:03:33 -07:00
Tom Coleman
16e0cac3e3 Upping the wait in "run and SIGKILL parent process" 2016-05-23 14:18:39 -07:00
Tom Coleman
249e4498b7 Increase timeout on test self-test (#6964) 2016-05-03 16:33:30 -07:00
Jesse Rosenberger
454a76191c Allow --port in "test" to allow a bindaddr, same as non-test
The `test` mode wasn't passing the proper proxyHost and proxyPort values to runAll.  This changes the behaviour to work the same as the regular `run` mode and also adds tests for both modes to test the bindaddr (localAddress) is taking effect properly.

Fixes meteor/meteor#6961
2016-05-03 17:35:57 +03:00
Slava Kim
3d2282d9ad fix imports for tests for tool-testing 2015-08-06 16:39:01 -07:00
Slava Kim
39d8aef3d9 move files into console/ tool-testing/ 2015-08-06 16:39:00 -07:00
Slava Kim
6b1bb038d8 Move files into tools/fs 2015-08-03 22:09:28 -07:00
Slava Kim
8a8db83d29 Move files into tools/utils 2015-08-03 20:32:38 -07:00
Slava Kim
3ddd281d8c Move catalog files into tools/catalog/ 2015-07-30 12:12:07 -07:00
Slava Kim
8900a8abfd WIP fixing minifiers 2015-07-13 15:59:13 -07:00
David Glasser
6470edf82a Fix tests broken by b6348d49
Since we no longer statically analyze app code, a syntax error in app JS
is now a run-time error, not a build-time error, which broke those
tests.  We still do some parsing on CSS as part of mergeCss, so bad CSS
will serve the same purpose.
2015-06-12 17:07:15 -07:00
David Glasser
a1e002a250 meteor run sees changes to .meteor/versions
`meteor run` doesn't always write changes to `.meteor/versions`: it only
does so if its release (or checkout-ness) matches `.meteor/release`.  So
it preferred to just remember the value of `.meteor/versions` from
rebuild to rebuild rather than forgetting what it knew and re-reading
the possibly-not-updated file.

However, if some other process changes `.meteor/versions`, it would
ignore that change.  With this fix, if `.meteor/versions` changes then
that is considered to be the previous versions list, not the last
version list from the same process.  For example, this would commonly
happen due to using `meteor update` to update packages (without changing
the tool, which would cause the runner to stop).

Fixes #3582.
2015-04-01 14:39:46 -04:00
sashko
168a39adae Fix fake mongo test on Windows 2015-03-31 08:12:03 -07:00
David Glasser
94683896b7 Don't ignore nonexistent settings file in run
Refactorings in 1.0.2 accidentally started ignoring errors related to
--settings.  Fixes #3757.
2015-02-17 16:36:39 -08:00
Avital Oliver
e866f7ca8c Tag known failing Windows self-tests
This way we can start running `meteor self-test` for regression testing,
while in parallel addressing the failures that are tagged by this commit.
2015-02-10 13:33:14 -08:00
Avital Oliver
15e87e33e8 Fix tests hard-coding METEOR as release track
Now it reads the value from catalog.DEFAULT_TRACK, which is both more
correct and necessary for the current "preview" state of Windows.

Fixed the following self-tests on Windows:
- run: update during run
- releases: springboard

Unfortunately, the autoupdate self-test still fails, maybe due to a real
bug?
2015-02-10 11:21:17 -08:00
Avital Oliver
8fb583507f Make "run" selftest pass on Windows 2015-02-06 13:47:15 -08:00
David Glasser
096df9d62d Refactor parent pid check; drop --keepalive
This commit moves parent pid process from the webapp package to the boot
script. This means that daemonized apps without webapp will also exit
when the runner exits, if run from the runner. (For example, several
self-tests such as 'autoupdate' no longer leak node processes.) This is
controlled via the $METEOR_PARENT_PID environment variable instead of
from command line arguments, in order to make fewer assumptions about
how Meteor apps process arguments.

This also drops the old --keepalive support (which already has stopped
being used by the dev mode runner or any MDG deployment platforms).
Neither --parent-pid nor --keepalive were documented beforehand, and
--keepalive was already deprecated before 1.0.

These flags used to also incidentally trigger printing the LISTENING
line; this is now controlled by $METEOR_PRINT_ON_LISTEN.

Fixes #3315.
2015-01-05 15:48:32 -08:00
Sashko Stubailo
e7167e5257 Factor out almost all fs. and path. calls in the tool
This will be useful when we want to be smart with windows file paths later
Also, all of the file calls are asynchronous with fibers now, which comes with
many benefits.

This is a combination of 23 commits. Original messages:
Wrap a large number of fs calls inside files.*

Convert a few more fs calls to files.*

More moving fs.* to files

Implement read/write streams and open/read/close

Get rid of fs from auth.js

Remove fs and unused imports from catalog-local and catalog-remote

Remove unused imports from catalog.js

Replace a whole lot of fs calls

Fix error

Migrate a lot more fs. calls to files.

Add a temporary symlink method

Convert old test to files.*

Use files.pathX instead of path.x everywhere

Replace path.x to files.pathX in tests

Small fixes to files.js and one rename

Make cleanup run in a fiber

Make wrapping functions take function name in case we need it

Add some timeouts and stuff to HCP tests

wrapFsFunc also makes a sync version of the function

Sometimes you just don't want to yield!

Make sure JsImage readFromDisk doesn't yield

Remove unused imports from npm test

Change order of test now that some things don't yield

Fix missing files import, and add a debug error printout
2014-12-15 15:32:06 -08:00
David Glasser
1e5b7437a5 Refresh catalog only on relevant errors
Fixes #2846.  Fixes #2847. Fixes #2979.

Errors in the build process that could be fixed by refreshing the
catalog now cause the catalog to refresh, assuming we have not already
refreshed it recently and that we are not offline.

These commands now don't need to refresh at startup: remove, run, debug,
create, build, bundle, deploy, test-packages, rebuild, and self-test

It should be OK for create to throw SpringboardToLatestRelease even
without refreshing, since release.latestKnown is still something we know
about.
2014-12-10 19:03:05 -08:00
David Glasser
21a34a98b3 Show mongod exit message if it started up OK
Fixes "run with mongo crash" test
2014-12-09 19:52:03 -08:00
David Glasser
118e330cba fix deadlock in mongod startup failure
AppRunner.stop needs to be able to cause any Future which the AppRunner
is waiting on to return, so that it can get back to the top level of its
loop and return. (This is because for some reason it is important that
AppRunner.stop does not return until the app is guaranteed to be
stopped.)  This had not been the place for the injected "wait for mongo
to start up before running the AppProcess" future.

This also means we can't use f.future() any more, because that code
assumes that it is the only code allowed to resolve its future (it
unconditionally resolves the future when the wrapped function returns,
which is an error if it is already resolved).

This is tested by 'run errors' which was failing.  Also, the test should
only expect 2 unexpected exit code messages, not 3, since we don't print
the message the first time which didn't have a kill before it.
2014-12-09 19:38:09 -08:00
David Glasser
c49a441d3d self-test: prepare apps after createApp
This means that the first command won't need to do a big build (and
print lots of package changed notifications). Similar to what 'meteor
create' does.

Also add --prepare-app command.
2014-12-01 14:43:15 -08:00
David Glasser
3b7459e62a start on self-test. file 'run' passes 2014-11-25 09:06:27 -08:00
Emily Stark
876d222f11 Fix 'update during run' test 2014-10-23 16:56:05 -07:00
David Glasser
0fb62f1686 make 'run' test pass 2014-10-23 10:51:20 -07:00
David Glasser
9d1adbc4f3 improve 'run: run' test 2014-10-23 10:51:20 -07:00
Emily Stark
bb29469856 Replace runtime config regression selftest with simpler unit test 2014-10-08 14:28:24 -07:00