Skip to content

Skip failing webdev integration_test cases #2051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 29 additions & 38 deletions webdev/test/integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ void main() {

test('Errors with `build_runner` should not surface `build_daemon` issues',
() async {
await d.file('pubspec.yaml', '''
name: sample
''').create();
await d.file('pubspec.yaml', _pubspecYaml).create();

await d
.file(
Expand All @@ -56,8 +54,7 @@ name: sample
.create();

await d.dir('.dart_tool', [d.file('package_config.json', '')]).create();
await d.file('.dart_tool/package_config.json', '''
''').create();
await d.file('.dart_tool/package_config.json', '').create();

var process =
await testRunner.runWebDev(['serve'], workingDirectory: d.sandbox);
Expand All @@ -79,18 +76,15 @@ name: sample
group('`$command` command', () {
group('missing dependency on', () {
test('`build_runner` should fail', () async {
await d.file('pubspec.yaml', '''
name: sample
''').create();
await d.file('pubspec.yaml', _pubspecYaml).create();

await d
.file('pubspec.lock', _pubspecLock(runnerVersion: null))
.create();

await d
.dir('.dart_tool', [d.file('package_config.json', '')]).create();
await d.file('.dart_tool/package_config.json', '''
''').create();
await d.file('.dart_tool/package_config.json', '').create();

var process = await testRunner
.runWebDev([command], workingDirectory: d.sandbox);
Expand All @@ -103,18 +97,15 @@ name: sample
});

test('`build_web_compilers` should fail', () async {
await d.file('pubspec.yaml', '''
name: sample
''').create();
await d.file('pubspec.yaml', _pubspecYaml).create();

await d
.file('pubspec.lock', _pubspecLock(webCompilersVersion: null))
.create();

await d
.dir('.dart_tool', [d.file('package_config.json', '')]).create();
await d.file('.dart_tool/package_config.json', '''
''').create();
await d.file('.dart_tool/package_config.json', '').create();

var process = await testRunner
.runWebDev(['serve'], workingDirectory: d.sandbox);
Expand All @@ -129,18 +120,15 @@ name: sample
test(
'`build_web_compilers` should be ignored with '
'--no-build-web-compilers', () async {
await d.file('pubspec.yaml', '''
name: sample
''').create();
await d.file('pubspec.yaml', _pubspecYaml).create();

await d
.file('pubspec.lock', _pubspecLock(webCompilersVersion: null))
.create();

await d
.dir('.dart_tool', [d.file('package_config.json', '')]).create();
await d.file('.dart_tool/package_config.json', '''
''').create();
await d.file('.dart_tool/package_config.json', '').create();

// Required for webdev to not complain about nothing to serve.
await d.dir('web').create();
Expand Down Expand Up @@ -177,9 +165,7 @@ name: sample
supportedRange = '^$_supportedBuildDaemonVersion';
}

await d.file('pubspec.yaml', '''
name: sample
''').create();
await d.file('pubspec.yaml', _pubspecYaml).create();

await d
.file(
Expand All @@ -192,8 +178,7 @@ name: sample

await d.dir(
'.dart_tool', [d.file('package_config.json', '')]).create();
await d.file('.dart_tool/package_config.json', '''
''').create();
await d.file('.dart_tool/package_config.json', '').create();

var process = await testRunner
.runWebDev(['serve'], workingDirectory: d.sandbox);
Expand Down Expand Up @@ -230,20 +215,22 @@ name: sample
await process.shouldExit(78);
});

test('pubspec.yaml, no pubspec.lock', () async {
await d.file('pubspec.yaml', '''
name: sample
''').create();
test(
'pubspec.yaml, no pubspec.lock',
() async {
await d.file('pubspec.yaml', _pubspecYaml).create();

var process =
await testRunner.runWebDev(['serve'], workingDirectory: d.sandbox);
var process = await testRunner
.runWebDev(['serve'], workingDirectory: d.sandbox);

await checkProcessStdout(process, [
'webdev could not run for this project.',
'No pubspec.lock file found, please run "$pubCommand get" first.'
]);
await process.shouldExit(78);
});
await checkProcessStdout(process, [
'webdev could not run for this project.',
'No pubspec.lock file found, please run "$pubCommand get" first.'
]);
await process.shouldExit(78);
},
skip: 'https://github.com/dart-lang/webdev/issues/2050',
);

test('should fail if there has been a dependency change', () async {
await d.file('pubspec.lock', _pubspecLock()).create();
Expand Down Expand Up @@ -271,7 +258,7 @@ dependencies:
'was generated, please run "$pubCommand get" again.'
]);
await process.shouldExit(78);
});
}, skip: 'https://github.com/dart-lang/webdev/issues/2050');
});
}
}
Expand All @@ -280,6 +267,10 @@ const _supportedBuildRunnerVersion = '2.4.0';
const _supportedWebCompilersVersion = '4.0.0';
const _supportedBuildDaemonVersion = '4.0.0';

String _pubspecYaml = '''
name: sample
''';

String _pubspecLock(
{String? runnerVersion = _supportedBuildRunnerVersion,
String? webCompilersVersion = _supportedWebCompilersVersion,
Expand Down