Revert "[test_runner] Invoke tests with relative paths."

This reverts commit b5294b9753.

Reason for revert: many failures on appjit, reload and fuchsia bots

Failure Link: <LINK TO FAILURE>

Original change's description:
> [test_runner] Invoke tests with relative paths.
>
> This makes tests more reproducible, and makes it easier to copy commands between workspaces, or between a failing bot and a local workspace.
>
> Change-Id: Ic8dd10a3540f314a406e5c5b0a23d97032e5d01d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/508364
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

Change-Id: Id7aa668c0609df65a5f622ae73013a15e7f9200e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/511400
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
Alexander Markov
2026-06-11 08:08:41 -07:00
committed by dart-scoped@luci-project-accounts.iam.gserviceaccount.com
parent 8e0ba59c7a
commit 9297d718a1
9 changed files with 28 additions and 19 deletions
+3 -1
View File
@@ -737,7 +737,9 @@ class AnalysisCommandOutput extends CommandOutput with _StaticErrorOutput {
files.sort();
for (var file in files) {
var path = Path(file!).toString();
var path = Path(
file!,
).relativeTo(testCase.testFile.path.directoryPath).toString();
output.subsection("unexpected analysis errors in $path");
var errors = errorsByFile[file]!;
@@ -1124,7 +1124,8 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration
List<String> arguments,
Map<String, String> environmentOverrides,
) {
var compareIl = 'pkg/vm/tool/compare_il$shellScriptExtension';
var pkgVmDir = Platform.script.resolve('../../../pkg/vm').toFilePath();
var compareIl = '$pkgVmDir/tool/compare_il$shellScriptExtension';
var args = [
arguments.firstWhere((arg) => arg.endsWith('_il_test.dart')),
@@ -1652,7 +1653,8 @@ abstract mixin class VMKernelCompilerMixin {
List<String> arguments,
Map<String, String> environmentOverrides,
) {
var genKernel = 'pkg/vm/tool/gen_kernel$shellScriptExtension';
var pkgVmDir = Platform.script.resolve('../../../pkg/vm').toFilePath();
var genKernel = '$pkgVmDir/tool/gen_kernel$shellScriptExtension';
var kernelBinariesFolder = _configuration.buildDirectory;
if (_useSdk) {
@@ -1682,10 +1684,10 @@ abstract mixin class VMKernelCompilerMixin {
name.startsWith('--enable-experiment=') ||
name.startsWith('--keep-class-names-implementing='),
),
if (isProductMode) '-Ddart.vm.product=true',
if (isAsan) '-Ddart.vm.asan=true',
if (isMsan) '-Ddart.vm.msan=true',
if (isTsan) '-Ddart.vm.tsan=true',
'-Ddart.vm.product=$isProductMode',
'-Ddart.vm.asan=$isAsan',
'-Ddart.vm.msan=$isMsan',
'-Ddart.vm.tsan=$isTsan',
if (_enableAsserts ||
arguments.contains('--enable-asserts') ||
arguments.contains('--enable_asserts'))
+6 -1
View File
@@ -14,6 +14,7 @@ import 'compiler_configuration.dart';
import 'deflake_info.dart';
import 'feature.dart';
import 'path.dart';
import 'repository.dart';
import 'runtime_configuration.dart';
import 'testing_servers.dart';
@@ -72,7 +73,11 @@ class TestConfiguration {
required this.reproducingArguments,
this.fastTestsOnly = false,
this.printPassingStdout = false,
}) : packages = packages ?? '.dart_tool/package_config.json';
}) : packages =
packages ??
Repository.uri
.resolve('.dart_tool/package_config.json')
.toFilePath();
final Map<String, RegExp?> selectors;
final Progress progress;
+1 -1
View File
@@ -360,5 +360,5 @@ Path _createMultitestDirectory(
.append(_suiteNameFromPath(suiteDir))
.join(relative);
TestUtils.mkdirRecursive(Path.workingDirectory, path);
return path;
return Path(File(path.toNativePath()).absolute.path);
}
+1 -1
View File
@@ -349,7 +349,7 @@ class TestFile extends _TestFileBase {
// The analyzer package also uses a similar syntax for expectations, but
// we don't want the test_runner to inadvertently think files containing
// those are static error tests.
if (!filePath.replaceAll('\\', '/').contains('pkg/analyzer/')) {
if (!filePath.replaceAll('\\', '/').contains('/pkg/analyzer/')) {
try {
errorExpectations.addAll(_parseExpectations(filePath));
} on FormatException catch (error) {
+8 -6
View File
@@ -246,7 +246,7 @@ abstract class TestSuite {
String dirname,
Path testPath,
) {
var relative = testPath;
var relative = testPath.relativeTo(Repository.dir);
relative = relative.directoryPath.append(relative.filenameWithoutExtension);
var testUniqueName = TestUtils.getShortName(relative.toString());
@@ -257,7 +257,7 @@ abstract class TestSuite {
TestUtils.mkdirRecursive(Path('.'), generatedTestPath);
return File(
generatedTestPath.toNativePath(),
).path.replaceAll('\\', '/');
).absolute.path.replaceAll('\\', '/');
}
/// Create a directories for generated assets (tests, html files,
@@ -393,7 +393,7 @@ class VMTestSuite extends TestSuite {
configuration.architecture == Architecture.x64c
? '$buildDir/gen/kernel-service.dart.snapshot'
: '$buildDir/gen/kernel_service.dill';
var dfePath = Path(filename).toNativePath();
var dfePath = Path(filename).absolute.toNativePath();
final experiments = [...configuration.experiments];
var args = [
...initialTargetArguments,
@@ -619,7 +619,7 @@ class StandardTestSuite extends TestSuite {
bool recursive = false,
}) : dartDir = Repository.dir,
listRecursively = recursive,
suiteDir = suiteDirectory,
suiteDir = Repository.dir.join(suiteDirectory),
extraVmOptions = configuration.vmOptions,
super(configuration, suiteName, statusFilePaths) {
// Initialize _dart2JsBootstrapDependencies.
@@ -1097,10 +1097,12 @@ class StandardTestSuite extends TestSuite {
} else if (configuration.compiler == Compiler.ddc) {
var ddcConfig =
configuration.compilerConfiguration as DevCompilerConfiguration;
var nameFromModuleRoot = testFile.path;
var nameFromModuleRoot = testFile.path.relativeTo(Repository.dir);
var nameFromModuleRootNoExt =
"${nameFromModuleRoot.directoryPath}/$nameNoExt";
var jsDir = Path(compilationTempDir).toString();
var jsDir = Path(
compilationTempDir,
).relativeTo(Repository.dir).toString();
var nativeNonNullAsserts = testFile.ddcOptions.contains(
'--native-null-assertions',
);
+1 -1
View File
@@ -133,7 +133,7 @@ class TestingServers {
int port = 0,
int crossOriginPort = 0,
}) async {
_packageConfig = await loadPackageConfigUri(Uri.base.resolveUri(_packages));
_packageConfig = await loadPackageConfigUri(_packages);
_server = await _startHttpServer(host, port: port);
await _startHttpServer(