0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-31 09:14:20 -04:00
Commit graph

52 commits

Author SHA1 Message Date
Nayeem Rahman
34328690dc
fix(test): output parallel test results independently (#15399) 2022-08-04 12:38:40 -04:00
Satya Rohith
6c3d9b981f
fix(cli): unset jsxFragmentFactory & jsxFactory options (#15264) 2022-07-21 14:44:18 +05:30
David Sherret
26cea0e2ca
feat(test): add --parallel flag, soft deprecate --jobs (#15259)
Co-authored-by: mrkldshv <markladyshev@gmail.com>
2022-07-20 17:36:54 -04:00
Roj
70d1ecaeaa
feat(cli): support configuring the test tool in the config file (#15079) 2022-07-18 15:12:19 -04:00
David Sherret
0d73eb3dd9
chore: fix flaky captured_output (#15234) 2022-07-18 13:20:15 -04:00
Mark Ladyshau
ee0c0586b3
feat(cli/test): add DENO_JOBS env variable for test subcommand (#14929) 2022-07-15 10:29:55 -04:00
Mark Ladyshau
d4f609d8e7
feat(test): update test summary report (#14629) 2022-06-14 20:51:49 +02:00
Nayeem Rahman
e3eae662f3
fix: Format non-error exceptions (#14604)
This commit adds "Deno.core.setFormatExceptionCallback" which
can be used to provide custom formatting for errors. It is useful
in cases when user throws something that is non-Error (eg.
a string, plain object, etc).
2022-06-06 20:26:57 +02:00
Bartek Iwańczuk
9a85a95c43
feat: subcommands type-check only local files by default (#14623)
This commit changes default mode of type-checking to "local" 
and adds "--check" flag to following subcommands:
- deno bench
- deno bundle
- deno cache
- deno compile
- deno eval
- deno install
- deno test
2022-05-17 23:53:42 +02:00
Nayeem Rahman
23efc4fcab
feat(test): Represent uncaught errors (#14513)
This commit adds better reporting of uncaught errors
in top level scope of testing files. This change affects
both console runner as well as LSP runner.
2022-05-09 11:44:50 +02:00
Adilson Schmitt Junior
256dcb058a
fix(test/bench): accept file protocol module specifier CLI args (#14429) 2022-05-02 15:43:03 -04:00
David Sherret
de33017a8b
fix(test): actually capture stdout and stderr in workers (#14435) 2022-05-01 14:44:55 -04:00
David Sherret
58eab0e2b3
fix(test): capture worker stdout and stderr in test output (#14410) 2022-04-26 19:00:04 -04:00
David Sherret
a1b4aa2ae6
fix(test): capture inherited stdout and stderr for subprocesses in test output (#14395) 2022-04-26 14:46:49 -04:00
Divy Srivastava
1c05e41f37
perf(runtime): bypass tokio file and bump op buffer size to 64K (#14319) 2022-04-19 20:11:31 +05:30
Nayeem Rahman
66fbdd2ed4
feat: Add DENO_NO_PROMPT variable (#14209)
This commit adds support for "DENO_NO_PROMPT" env
variable, that can be used instead of "--no-prompt" flag
to completely disable permission prompts.
2022-04-18 21:08:30 +02:00
Bartek Iwańczuk
9c5928b5aa
fix: panic when trying to pledge permissions before restoring previous pledge (#14306)
This commit fixes and edge case, where testing/benching code could pledge new
permission set before restoring the previous pledge.

Appropriate panics were added and tests that assert that process is killed
in case of "recursive pledge".
2022-04-17 17:47:24 +02:00
Nayeem Rahman
8b31fc23cd
refactor: Move source map lookups to core (#14274)
The following transformations gradually faced by "JsError" have all been 
moved up front to "JsError::from_v8_exception()": 

- finding the first non-"deno:" source line; 
- moving "JsError::script_resource_name" etc. into the first error stack 
in case of syntax errors; 
- source mapping "JsError::script_resource_name" etc. when wrapping 
the error even though the frame locations are source mapped earlier; 
- removing "JsError::{script_resource_name,line_number,start_column,end_column}"
entirely in favour of "js_error.frames.get(0)". 

We also no longer pass a js-side callback to "core/02_error.js" from cli. 
I avoided doing this on previous occasions because the source map lookups 
were in an awkward place.
2022-04-15 16:08:09 +02:00
Bartek Iwańczuk
244926e83c
feat(test): format user code output (#14271)
This commit changes "deno test" to better denote user output coming
from test cases.

This is done by printing "---- output ----" and "---- output end ----"
markers if an output is produced. The output from "console" and
"Deno.core.print" is captured, as well as direct writes to "Deno.stdout"
and "Deno.stderr".

To achieve that new APIs were added to "deno_core" crate, that allow
to replace an existing resource with a different one (while keeping resource
ids intact). Resources for stdout and stderr are replaced by pipes.

Co-authored-by: David Sherret <dsherret@gmail.com>
2022-04-15 14:24:41 +02:00
Bartek Iwańczuk
c8313a7457
feat(test): Improve testing report output (#14255)
Following changes were done in this commit:

- remove "test" prefix before each test
- use gray color for "running N tests from ..." prompt
- use relative path or remote URL instead of full URL in "running N tests from ..." prompt
- in "failures" section, add file path/remote URL before the test name

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2022-04-11 18:27:17 +02:00
Bartek Iwańczuk
c3f306d778
fix(test): don't error on missing op details (#14074) 2022-03-23 00:24:45 +01:00
Geert-Jan Zwiers
8db3a9546b
fix(test): skip typechecking for blocks inside HTML comments (#13889) 2022-03-11 02:14:32 +01:00
Geert-Jan Zwiers
e53b6c16bc
fix(test): typecheck blocks annotated with long js/ts notations (#13785) 2022-03-08 02:10:40 +01:00
Bartek Iwańczuk
4bea1d06c7
fix(test): use --no-prompt by default (#13777)
This commit changes "deno test" subcommand, to
always never prompt for permissions (ie. as if "deno test"
was run with "--no-prompt" flag).
2022-02-26 14:49:50 +01:00
Bartek Iwańczuk
d332bf1132
feat: deno test --trace-ops (#13770)
This commit adds "--trace-ops" flag to "deno test" subcommand.

This flag enables saving of stack traces for async ops, that before were always
saved. While the feature proved to be very useful it comes with a significant performance
hit, it's caused by excessive source mapping of stack frames.
2022-02-25 16:14:46 +01:00
Luca Casonato
b53997273d
feat(test): better errors for resource sanitizer (#13296)
This commit makes the errors produced from the resource sanitizer much
more human readable. It does this by using real words rather than our
"resource names" when referring to resources, and by giving helpful
hints on how to clean up each of the resources.
2022-01-25 17:03:38 +01:00
David Sherret
0f3a53e5d4
feat: stabilize test steps API (#13400) 2022-01-18 15:02:56 -05:00
Ryan Dahl
1fb5858009
chore: update copyright to 2022 (#13306)
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
2022-01-07 22:09:52 -05:00
Andreu Botella
33da15ae5a
refactor(timers): refactor timers to use one async op per timer (#12862)
This change also makes the timers implementation closer to the spec, and
sets up the stage to implement AbortSignal.timeout() (whatwg/dom#1032).

Fixes #8965
Fixes #10974
Fixes #11398
2021-12-07 13:39:58 +01:00
Andreu Botella
9a10668694
fix(test): Improve reliability of deno test's op sanitizer with timers (#12934)
Although not easy to replicate in the wild, the `deno test` op sanitizer
can fail when there are intervals that started before a test runs, since
the op sanitizer can end up running in the time between the timer op for
an interval's run resolves and the op for the next run starts.

This change fixes that by adding a new macrotask callback that will run
after the timer macrotask queue has drained. This ensures that there is
a timer op if there are any timers which are unresolved by the time the
op sanitizer runs.
2021-11-30 01:27:30 +01:00
Bartek Iwańczuk
5178e093ed
Revert "fix(test): Improve reliability of deno test's op sanitizer with timers (#12908)" (#12929)
This reverts commit d335343a79.
2021-11-29 12:07:47 +01:00
Andreu Botella
d335343a79
fix(test): Improve reliability of deno test's op sanitizer with timers (#12908)
Although not easy to replicate in the wild, the `deno test` op sanitizer
can fail when there are intervals that started before a test runs, since
the op sanitizer can end up running in the time between the timer op for
an interval's run resolves and the op for the next run starts.

This change fixes that by adding a new macrotask callback that will run
after the timer macrotask queue has drained. This ensures that there is
a timer op if there are any timers which are unresolved by the time the
op sanitizer runs.
2021-11-28 16:40:38 +01:00
Bartek Iwańczuk
d8afd56838
feat(test): Add more overloads for "Deno.test" (#12749)
This commit adds 4 more overloads to "Deno.test()" API.

```
// Deno.test(function testName() { });
export function test(fn: (t: TestContext) => void | Promise<void>): void;

// Deno.test("test name", { only: true }, function() { });
export function test(
  name: string,
  options: Omit<TestDefinition, "name">,
  fn: (t: TestContext) => void | Promise<void>,
): void;

// Deno.test({ name: "test name" }, function() { });
export function test(
  options: Omit<TestDefinition, "fn">,
  fn: (t: TestContext) => void | Promise<void>,
): void;

// Deno.test({ only: true }, function testName() { });
export function test(
  options: Omit<TestDefinition, "fn" | "name">,
  fn: (t: TestContext) => void | Promise<void>,
): void;
```
2021-11-23 14:57:51 +01:00
Geert-Jan Zwiers
58e7b290dc
fix(test): support typechecking docs with CRLF line endings (#12748) 2021-11-15 09:58:04 -05:00
Casper Beyer
1683044ed9
feat: provide ops details for ops sanitizer failures (#12188) 2021-10-11 17:00:33 +02:00
David Sherret
426ebf854a
feat(unstable/test): imperative test steps API (#12190) 2021-10-11 09:45:02 -04:00
Casper Beyer
6bf5c850e6
fix(runtime/testing): format aggregate errors (#12183) 2021-09-30 21:54:56 +02:00
Casper Beyer
f9d29115a0
feat(cli): close test worker once all tests complete (#11727) 2021-09-04 20:19:26 +02:00
Casper Beyer
77ead8af20
fix(cli): retain path based test mode inference (#11878) 2021-09-01 18:31:56 +09:00
Casper Beyer
a7240c5091
feat(cli): add --ignore flag to test command (#11712) 2021-08-24 17:23:29 +02:00
Casper Beyer
d1fe03d677
fix(test): dispatch load event before tests are run (#11708) 2021-08-15 13:54:44 +02:00
Casper Beyer
293eed0ef2
test(cli): add test for test filtering (#11672) 2021-08-13 11:33:18 +02:00
Casper Beyer
3dff757927
fix(cli): allow specifiers of unknown media types with test command (#11652) 2021-08-12 20:10:14 +02:00
Casper Beyer
c276b52828
feat: type check codeblocks in Markdown file with "deno test --doc" (#11421) 2021-07-29 21:03:06 +02:00
Casper Beyer
b2fcd3d014
fix(cli): side-load test modules (#11515)
This fixes a regression introduced in 1.9 where test modules became main
modules by side loading them in a generated module.
2021-07-26 14:05:44 +02:00
Casper Beyer
844910e44f
test(cli): ensure clear timeout doesn't trigger sanitizers (#11396) 2021-07-14 19:47:47 +02:00
Ryan Dahl
67c9937e66
Revert "feat(cli/tools/test_runner): add terse reporter (#11156)" (#11352)
it's another flag to understand, more code, and isn't something that anyone really needs.

This reverts commit 9d57a4aaeb.
2021-07-10 07:51:30 -07:00
Casper Beyer
9d57a4aaeb
feat(cli/tools/test_runner): add terse reporter (#11156)
This commit adds "--terse" flag to "deno test" that makes testing reporter
output one character per test case instead of one line per case.

This is an unstable feature.
2021-07-10 01:29:18 +02:00
Casper Beyer
e8258e0210
feat(test): add --shuffle flag to randomize test ordering (#11163) 2021-07-05 21:20:33 -04:00
Casper Beyer
407de8b834
fix(runtime): ignored tests should not cause permission changes (#11278) 2021-07-05 18:36:43 +02:00