Skip to content

Wrong reading of environment variable. #54568

@polina-c

Description

@polina-c

Code in flutter_test_config.dart:

import 'dart:io';
...
const String _myVarConst = String.fromEnvironment('LEAK_TRACKING');
String _myVarFromPlatform = Platform.environment['LEAK_TRACKING'] ?? '';

debugPrint('!!! _myVarConst: [$_myVarConst]');
debugPrint('!!! _myVarFromPlatform: [$_myVarFromPlatform]');

With command flutter test --dart-define LEAK_TRACKING=true on mac:

!!! _myVarConst: [true]
!!! _myVarFromPlatform: []

When running on windows bots on github:

!!! _myVarConst: []
!!! _myVarFromPlatform: [true]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions