Commit graph

665 commits

Author SHA1 Message Date
Ryan Dahl ec1946a95e
Improve run_and_collect_output (#4272)
* Fix flaky test test_permissions_net_listen_allow_localhost

* Improve error reporting for run_and_collect_output
2020-03-07 11:27:16 +01:00
Ryan Dahl 61f12ea775
Fix flaky test test_permissions_net_listen_allow_localhost (#4271) 2020-03-06 17:40:18 +01:00
Aurélien Bertron 5e31b96f9a
Add content type for wasm, fix encoding in wasm test fixture (#4269) 2020-03-06 11:31:22 -05:00
dubiousjim acf0958e94
Rename name/filename arguments to path (#4227)
There's a lot of variation in doc comments and internal code about
whether the first parameter to file system calls is `path` or `name` or
`filename`. For consistency, have made it always be `path`.
2020-03-06 11:29:23 -05:00
João Souto e81fb25b7a
Fix unwanted ANSI Reset Sequence (#4268) 2020-03-06 08:48:38 -05:00
dubiousjim 9a63902db5
Rename readDir -> readdir (#4225) 2020-03-06 08:34:02 -05:00
Ryan Dahl afea9b2edd
fix: call unwatch when dropping FsEventsResource (#4266) 2020-03-05 20:01:08 -05:00
Bartek Iwańczuk 2e59007214 move Web APIs to cli/js/web/ 2020-03-05 18:48:55 +01:00
Bartek Iwańczuk 9b59ed7c79 fix event target tests 2020-03-05 11:09:04 -05:00
Ryan Dahl c850b258b4
Support async function and EventListenerObject as listeners (#4240) 2020-03-05 08:36:13 -05:00
Ryan Dahl 54a1688868
Allow BadResource errors to take a custom message (#4251) 2020-03-05 08:30:41 -05:00
Bartek Iwańczuk 20dad3659c
refactor: preliminary cleanup of Deno.runTests() (#4237)
* refactor: preliminary cleanup of Deno.runTests()

* Change time measurement to use new Date() instead of
  performance.now(). Because there is no guarantee that tests are
  run with "--allow-hr" using new Date() guarantees higher
  precision of 1ms instead of 2ms.

* Support String type filter in "skip" and "only".

* Split "exitOnFail" into "exitOnFail" and "failFast".
  Former tells if "runTests()" should exit with code 1 on test
  failure, while latter tells if "runTests()" should stop
  running tests on first failure.

* Use "defer" to wait for unhandled promise rejection - this bit
  is funky and doesn't seem right, but for now it's just a rewrite
  from using "setTimeout". Intended to be fixed in later commits.

* Remove global "__DENO_TEST_REGISTRY", don't expose list of
  registered tests (to be addressed in follow up commits)

* Remove arbitrary slow test threshold; use uniform coloring
  instead
2020-03-05 11:52:18 +01:00
Bartek Iwańczuk 52b96fc22a
refactor: cleanup compiler runtimes (#4230)
- Cleanup "tsCompilerOnMessage" by factoring out separate methods for each 
  request type:
    * "compile"
    * "runtimeCompile"
    * "runtimeTranspile"
- Simplify control flow of compiler workers by a) no longer calling "close()" in worker runtime after a
single message; b) explicitly shutting down worker from host after a single message

Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-03-05 11:13:10 +01:00
Bert Belder 5d3dfa4cf6
Remove unnecessary macro from cli/ops/tty.rs (#4254)
It contains a clippy issue, and there's no need for this macro anyway.
2020-03-04 15:54:09 -08:00
Ryan Dahl a1b98e9e6a
Remove Deno.errors.Other (#4249) 2020-03-04 13:18:32 -05:00
Bartek Iwańczuk 8d96dffa41
refactor: rewrite testPerm into unitTest (#4231)
Rewrite "testPerm" helper function used for testing of internal 
runtime code. It's been renamed to "unitTest" and provides API that
is extensible in the future by accepting optional "UnitTestOptions" 
argument. "test" helper was also removed and replaced by
overloaded version of "unitTest" that takes only function argument.

"UnitTestOptions" currently supports "perms" and "skip"
options, where former works exactly as first argument to "testPerm"
did, while the latter allows to conditionally skip tests.
2020-03-04 17:31:14 +01:00
Kitson Kelly 30682cf74f
Migrate internal bundles to System (#4233) 2020-03-04 14:26:00 +01:00
yuta0801 5e7ca445ff
Fix deno install file name including extra dot on Windows (#4243) 2020-03-04 00:40:56 -08:00
Ryan Dahl ce5a57667c
Disable flaky and broken tests (#4239) 2020-03-03 16:02:35 -05:00
Bartek Iwańczuk ee452ad883
add assertOps sanitizer in cli/js/ unit tests (#4209)
* add "assertOps" test assertion which makes sure test case
  is not "leaking" ops - ie. after test finishes there are no 
  pending async ops

* apply "assertOps" to all tests in "cli/js/"

* fix numerous tests leaking ops

* document problem with edge case in "clearInterval"
   and "clearTimeout" implementation where they
   may leak async ops

* move "cli/js/worker_test.ts" to "cli/tests/worker_test.ts" and 
  run as integration test; workers leak ops because of missing
  "terminate" implementation
2020-03-03 18:22:53 +01:00
Yusuke Sakurai 4dc004f0a2
misc: reduce unnecesarry output in cli/js tests (#4182)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-03-03 15:51:07 +01:00
Bert Belder eafd40feab
Do not convert exceptions to JSON and back (#4214) 2020-03-02 14:20:16 -08:00
Kitson Kelly 83d902a780
Fix JavaScript dependencies in bundles. (#4215)
Fixes #4602

We turned off `allowJs` by default, to keep the compiler from grabbing
a bunch of files that it wouldn't actually do anything useful with.  On
the other hand, this caused problems with bundles, where the compiler
needs to gather all the dependencies, including JavaScript ones.  This
fixes this so that when we are bundling, we analyse JavaScript imports
in the compiler.
2020-03-02 22:18:27 +01:00
dubiousjim a3c3a56ff7
Rename Option -> Options (#4226)
* Rename MkdirOption interface to MkdirOptions

It was hard to remember which Options interfaces were spelled in the
singular and which in the plural (and anyway this one contained two
options).

Also added MkdirOptions to cli/js/deno.ts. All the analogous interfaces
were exported there.

* Rename RemoveOption interface to RemoveOptions

This was the last remaining Option interface spelled in the singular.
Easier to remember if they're all Option**s**; plus we may want to add extra
options here later.
2020-03-02 21:24:42 +01:00
Bartek Iwańczuk ff5bba3be8
feat: update metrics to track different op types (#4221) 2020-03-02 19:13:36 +01:00
Bartek Iwańczuk cfe4369ded
refactor: rename structures related to Modules (#4217)
* rename structures related to ES Modules; add "Modules" prefix
* remove unneeded Unpin trait requirement for "ModuleLoader"
2020-03-02 19:12:49 +01:00
bartOssh 4a47ffa5c4
seek should return cursor position (#4211) 2020-03-02 11:44:46 -05:00
dubiousjim 6cd46fa3ef
Cleanup comments and internal variables (#4205) 2020-03-02 10:19:42 -05:00
João Souto 809019dc6e
Port Complex Permissions Tests to Rust (#4200) 2020-03-01 19:51:54 -05:00
ecyrbe 2a594bd3b2
feat(std/node): add os.tmpdir() implementation (#4213) 2020-03-01 19:05:04 -05:00
Ryan Dahl ad21210edd
perf: use subarray instead of slice in dispatch minimal (#4180) 2020-03-01 17:17:59 -05:00
Kevin (Kun) "Kassimo" Qian c3661e9f07
Make internel error frames dimmer (#4201) 2020-03-01 16:17:44 -05:00
Chris Knight b84f3efa14
docs: fix broken Deno.write() example (#4190) 2020-02-29 20:37:32 +01:00
Nayeem Rahman 1f9d158bdc
refactor(cli/js): Replace constructError() with getErrorClass() (#4189)
Flattens dispatch error handling to produce one less useless stack frame on op errors.
2020-02-29 19:04:10 +01:00
Bartek Iwańczuk f55b22e195
add assertResources sanitizer to cli/js/ unit tests (#4161) 2020-02-29 18:45:47 +01:00
Ryan Dahl a29343c7d6 v0.35.0 2020-02-28 23:49:49 -05:00
Bartek Iwańczuk bdf95c7b72
Revert "perf: use subarray instead of slice in dispatch minimal (#4173)" (#4174)
This reverts commit 0eb91c5591.
2020-02-28 19:33:52 +01:00
Ryan Dahl 0099c28db3
http_cache: change .headers.json to .metadata.json (#4175)
Add original URL to metadata. This is so the VS Code Plugin can reverse
look up the URL for cache entries. Ref #4069.
2020-02-28 13:15:31 -05:00
Bartek Iwańczuk 0eb91c5591
perf: use subarray instead of slice in dispatch minimal (#4173) 2020-02-28 17:13:07 +01:00
Kitson Kelly 0a51611d76
Clean up lib.deno.ns.d.ts JSDoc (#4170) 2020-02-28 11:05:40 -05:00
Bartek Iwańczuk a13b0e2727
rewrite permission revoke test as integration test (#4164) 2020-02-28 15:47:54 +01:00
Kevin (Kun) "Kassimo" Qian 7255cc9bc0
Support TypeScript eval through deno eval -T flag (#4141) 2020-02-28 09:17:56 -05:00
Kevin (Kun) "Kassimo" Qian b5bf28e68f
fetch_cached_remote_source support redirect URL without base (#4099) 2020-02-28 09:04:18 -05:00
Bartek Iwańczuk 9b6a9b769e
Revert "chore: share HTTP server between tests (#3966)" (#4165)
This reverts commit e6167c7813.
2020-02-27 23:32:02 -08:00
Bert Belder 1cb1ab6c00
Merge mod_evaluate() and mod_evaluate_dyn_import() methods (#4167) 2020-02-27 16:30:18 -08:00
Ryan Dahl 973dbd1ba1
Return non-zero exit code on malformed stdin fmt (#4163) 2020-02-27 15:39:41 -05:00
Bartek Iwańczuk fa5f3aa600
replace impl Future with poll_fn for net.rs, process.rs, tls.rs (#4158) 2020-02-27 21:08:21 +01:00
Kitson Kelly 1d26da6a47
feat: Support types compiler option in compiler APIs (#4155)
Handles `types` in the compiler APIs to make it easier to supply
external type libraries.
2020-02-27 11:27:00 -05:00
Bartek Iwańczuk daf7617f42
rewrite normalize_path (#4143)
Rewrite "normalize_path()" to remove all intermediate components from the path, ie. "./" and "../". It's very similar in functionality to fs::canonicalize(), however "normalize_path() doesn't resolve symlinks.
2020-02-26 22:11:52 +01:00
Bartek Iwańczuk 7fff2d2d1e
remove Read/Write futures, use poll_fn instead (#4150) 2020-02-26 22:06:20 +01:00