Skip to content

Lambda Test Tool Tests Fail to Find Path #1557

@joshuaseither

Description

@joshuaseither

Describe the bug

Some of the lambda test tool tests fail because the path to the test binaries are not found.

This happens on case sensitive file systems because the path to the files uses debug as opposed to Debug.

Expected Behavior

All the tests pass.

Current Behavior

Some of the tests fail with example exception:

Failed Amazon.Lambda.TestTool.Tests.NET6.SourceGeneratorTests.SourceGeneratorInputAndOutput [< 1 ms]
  Error Message:
   Assert.Contains() Failure
Not found: Response = FooBar
In value:  Unknown error occurred causing process exit: Could not find a part of the path '/home/joshua/projects/aws/aws-lambda-dotnet/Tools/LambdaTestTool/tests/LambdaFunctions/net6/SourceGeneratorExample/bin/debug/net6.0'.
   at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
   at System.IO.Enumeration.FileSystemEnumerator`1.Init()
   at System.IO.Enumeration.FileSystemEnumerator`1..ctor(String directory, Boolean isNormalized, EnumerationOptions options)
   at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
   at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles(String directory, String expression, EnumerationOptions options)
   at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
   at System.IO.Directory.GetFiles(String path, String searchPattern, EnumerationOptions enumerationOptions)
   at System.IO.Directory.GetFiles(String path, String searchPattern)
   at Amazon.Lambda.TestTool.Utils.IsProjectDirectory(String directory) in /home/joshua/projects/aws/aws-lambda-dotnet/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool/Utils.cs:line 104
   at Amazon.Lambda.TestTool.TestToolStartup.Startup(String productName, Action`2 uiStartup, String[] args, RunConfiguration runConfiguration) in /home/joshua/projects/aws/aws-lambda-dotnet/Tools/LambdaTestTool/src/Amazon.Lambda.TestTool/TestToolStartup.cs:line 74

Reproduction Steps

# Assume repository root is working directory
cd ./Tools/LambdaTestTool
dotnet test

Possible Solution

#1558

Additional Information/Context

I'm running this on a linux machine which is why the case matters. On windows, I do not experience this problem.

AWS .NET SDK and/or Package version used

The master branch of this repository.

Targeted .NET Platform

.NET 6

Operating System and version

Arch Linux, Ubuntu 22.04.2 via WSL

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions