From b92f80e22a570d284a698f4d022fbb268081046e Mon Sep 17 00:00:00 2001 From: xster Date: Tue, 18 Aug 2020 17:16:04 -0700 Subject: [PATCH] Incorrect path.join usage might be causing Windows test failures (#64056) --- .../module_custom_host_app_name_test.dart | 19 ++++++++++++------- dev/devicelab/bin/tasks/module_test.dart | 19 ++++++++++++------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/dev/devicelab/bin/tasks/module_custom_host_app_name_test.dart b/dev/devicelab/bin/tasks/module_custom_host_app_name_test.dart index ae63ad3868..5fa7b48a60 100644 --- a/dev/devicelab/bin/tasks/module_custom_host_app_name_test.dart +++ b/dev/devicelab/bin/tasks/module_custom_host_app_name_test.dart @@ -42,7 +42,8 @@ Future main() async { final File readonlyTxtAssetFile = await File(path.join( projectDir.path, - 'assets/read-only.txt' + 'assets', + 'read-only.txt' )) .create(recursive: true); @@ -253,7 +254,7 @@ Future main() async { section('Check file access modes for read-only asset from Flutter module'); - final String readonlyDebugAssetFilePath = path.join( + final String readonlyDebugAssetFilePath = path.joinAll([ hostApp.path, 'SampleApp', 'build', @@ -261,8 +262,10 @@ Future main() async { 'merged_assets', 'debug', 'out', - 'flutter_assets/assets/read-only.txt', - ); + 'flutter_assets', + 'assets', + 'read-only.txt', + ]); final File readonlyDebugAssetFile = File(readonlyDebugAssetFilePath); if (!exists(readonlyDebugAssetFile)) { return TaskResult.failure('Failed to copy read-only asset file'); @@ -323,7 +326,7 @@ Future main() async { section('Check file access modes for read-only asset from Flutter module'); - final String readonlyReleaseAssetFilePath = path.join( + final String readonlyReleaseAssetFilePath = path.joinAll([ hostApp.path, 'SampleApp', 'build', @@ -331,8 +334,10 @@ Future main() async { 'merged_assets', 'release', 'out', - 'flutter_assets/assets/read-only.txt', - ); + 'flutter_assets', + 'assets', + 'read-only.txt', + ]); final File readonlyReleaseAssetFile = File(readonlyReleaseAssetFilePath); if (!exists(readonlyReleaseAssetFile)) { return TaskResult.failure('Failed to copy read-only asset file'); diff --git a/dev/devicelab/bin/tasks/module_test.dart b/dev/devicelab/bin/tasks/module_test.dart index f52caeef82..8d19492e25 100644 --- a/dev/devicelab/bin/tasks/module_test.dart +++ b/dev/devicelab/bin/tasks/module_test.dart @@ -42,7 +42,8 @@ Future main() async { final File readonlyTxtAssetFile = await File(path.join( projectDir.path, - 'assets/read-only.txt' + 'assets', + 'read-only.txt' )) .create(recursive: true); @@ -253,7 +254,7 @@ Future main() async { section('Check file access modes for read-only asset from Flutter module'); - final String readonlyDebugAssetFilePath = path.join( + final String readonlyDebugAssetFilePath = path.joinAll([ hostApp.path, 'app', 'build', @@ -261,8 +262,10 @@ Future main() async { 'merged_assets', 'debug', 'out', - 'flutter_assets/assets/read-only.txt', - ); + 'flutter_assets', + 'assets', + 'read-only.txt', + ]); final File readonlyDebugAssetFile = File(readonlyDebugAssetFilePath); if (!exists(readonlyDebugAssetFile)) { return TaskResult.failure('Failed to copy read-only asset file'); @@ -323,7 +326,7 @@ Future main() async { section('Check file access modes for read-only asset from Flutter module'); - final String readonlyReleaseAssetFilePath = path.join( + final String readonlyReleaseAssetFilePath = path.joinAll([ hostApp.path, 'app', 'build', @@ -331,8 +334,10 @@ Future main() async { 'merged_assets', 'release', 'out', - 'flutter_assets/assets/read-only.txt', - ); + 'flutter_assets', + 'assets', + 'read-only.txt', + ]); final File readonlyReleaseAssetFile = File(readonlyReleaseAssetFilePath); if (!exists(readonlyReleaseAssetFile)) { return TaskResult.failure('Failed to copy read-only asset file');