dart-lang / dart-lang/test

Various errors on build_runner + node

Open
#862 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
536
Forks
232
Avg merge
1d 10h
Merged PRs (30d)
10

Description

```
Dart VM version: 2.0.0-dev.60.0 (Mon Jun 4 22:09:13 2018 +0200) on "windows_x64"
```

```dart
import 'package:test/test.dart';
void main() {
test('True test', () {
expect(true, isTrue);
});
}
```

Compiles and runs fine with `-p chrome`.
```
> pub run build_runner test -- -p chrome
[INFO] Generating build script completed, took 697ms
[INFO] Reading cached asset graph completed, took 308ms
[INFO] Checking for updates since last build completed, took 486ms
[INFO] Running build completed, took 192ms
[INFO] Caching finalized dependency graph completed, took 131ms
[INFO] Creating merged output dir `C:\Users\alexey\AppData\Local\Temp\build_runner_test5e375219-6c0f-11e8-85b0-1c1b0d0d6f72\` completed, took 12.9s
[INFO] Writing asset manifest completed, took 10ms
[INFO] Succeeded after 13.3s with 0 outputs (0 actions)
Running tests...

00:01 +1: All tests passed!
```

Fails to compile with `-p node`.
```
> pub run build_runner test -- -p node
[INFO] Generating build script completed, took 685ms
[INFO] Reading cached asset graph completed, took 302ms
[INFO] Checking for updates since last build completed, took 470ms
[INFO] Running build completed, took 200ms
[INFO] Caching finalized dependency graph completed, took 131ms
[INFO] Creating merged output dir `C:\Users\alexey\AppData\Local\Temp\build_runner_test9bd8b120-6c0f-11e8-85b0-1c1b0d0d6f72\` completed, took 12.7s
[INFO] Writing asset manifest completed, took 8ms
[INFO] Succeeded after 13.1s with 0 outputs (0 actions)
Running tests...

00:00 +0 -1: compiling test\validate_test.dart [E]
Failed to load "test\validate_test.dart":
Cannot open file, path = 'C:\Users\alexey\AppData\Local\Temp\build_runner_test9bd8b120-6c0f-11e8-85b0-1c1b0d0d6f72\test\validate_test.dart.node_test.dart.js.map' (OS Error: The system cannot find the file specified., errno = 2)
00:00 +0 -1: Some tests failed.
```

Fails inside node with `-p node --js-trace`.
```
> pub run build_runner test -- -p node --js-trace
[INFO] Generating build script completed, took 690ms
[INFO] Reading cached asset graph completed, took 351ms
[INFO] Checking for updates since last build completed, took 492ms
[INFO] Running build completed, took 215ms
[INFO] Caching finalized dependency graph completed, took 132ms
[INFO] Creating merged output dir `C:\Users\alexey\AppData\Local\Temp\build_runner_testf54c97c4-6c0f-11e8-85b0-1c1b0d0d6f72\` completed, took 12.9s
[INFO] Writing asset manifest completed, took 14ms
[INFO] Succeeded after 13.3s with 0 outputs (0 actions)
Running tests...

00:00 +0: compiling test\validate_test.dart
internal/modules/cjs/loader.js:596
throw err;
^

Error: Cannot find module 'C:\Users\alexey\AppData\Local\Temp\build_runner_testf54c97c4-6c0f-11e8-85b0-1c1b0d0d6f72\test\validate_test.dart.node_test.dart.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
at Function.Module._load (internal/modules/cjs/loader.js:520:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:10)
at startup (internal/bootstrap/node.js:238:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:572:3)
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the report with `pub run build_runner test -- -p node` and with `--js-trace`, comparing both against `-p chrome`. Start with the generated output for `test/validate_test.dart` and the missing `.node_test.dart.js` and `.js.map` files. Done means the Node test compiles and runs without either missing-file error.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, node.js
Domain
build-system, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.