none
U-SQL Unit Tests path too long exception

    Question

  • When i try to run unit tests for u-sql as described in the docs, i get the following message:

    Failed in unpacking U-SQL project package "C:\usql_data_lake_test\USQLUnitTests\adla_UnitTest\bin\Debug\u_sql_data_lake_test.usqlpack" due to:
    System.IO.PathTooLongException...

    I don't see any way I can shortcut my path,

    this is the unit test code (inside the test method):

    USqlScriptTestRunner testRunner = new USqlScriptTestRunner(uSqlProjectOutputRelativePath: @"usql_data_lake_test.usqlpack", cppSdkFolderFullPath: @"");
                // Test data and databases will be deployed locally.
                testRunner.Initialize();
                // scriptFileRelativePath is set to the relative path of the script to be tested. The script is included in the build output from U-SQL project usql_data_lake_test.
                USqlScriptTestResult testResult = testRunner.Run(scriptFileRelativePath: @"TestScript.usql");
                // testResult.ErrorMessage includes error details if the test case fails.
                Assert.IsTrue(testResult.IsSuccessful, testResult.ErrorMessage);

    It is known bug? Is it something I need to change in my environment?


    • Edited by Dor Meiri Wednesday, February 20, 2019 12:27 PM
    Wednesday, February 20, 2019 12:26 PM

All replies

  • Hello,

    Instead of saving to physical directory on the server (it could be C:\usql_data_lake_test\USQLUnitTests\adla_UnitTest\bin\Debug\u_sql_data_lake_test.usqlpack). Can you change the logic to save the file to a different location? Like d:\ usql_data_lake_test\sample.usql

    OR

    You may refer SO thread which addressing similar issue.

    Hope this helps.

    Thursday, February 21, 2019 8:55 AM
    Moderator
  • Just checking in to see if the above answer helped. If this answers your query, do click “Mark as Answer” and Up-Vote for the same. And, if you have any further query do let us know.

    Tuesday, February 26, 2019 9:20 AM
    Moderator
  • This is the path generated by Visual Studio, i can't do any shorter than that, my root folder is c:\myfolder
    Sunday, March 10, 2019 1:30 PM
  • Hi Dor Meiri,

    Have you tried the suggestions mentioned in SO thread?

    Wednesday, March 13, 2019 5:46 AM
    Moderator