Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

cannot find test files while running tests through pipeline

sschroders August 21, 2024

I have some test date in files setup for my test cases. I have these as embedded resource setup which are copied when newer in visual studio. however, when I run my tests through bitbucket pipeline I get the following error: 

Could not find a part of the path '/opt/atlassian/pipelines/agent/build/Athene/Micro Services/Excel Services/ExcelServiceTests/bin/Release/net8.0/Test Data/test.xlsx'.

How can i fix this?

1 answer

1 accepted

0 votes
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 23, 2024

Hello @sschroders ,

thank you for reaching out to the community.

When running tests in a CI/CD pipeline like Bitbucket Pipelines, you need to ensure that any required files are available at the expected path during the test execution. 

My understanding is that you have some static test files that are used during the tests executed on your pipeline. In this case, you need to make sure that your test data files are included in your repository.

Files needed for testing should be committed to the repository so they can be checked out during pipeline execution.

Thank you, @sschroders !

Patrik S

sschroders August 26, 2024

@Patrik S Thanks for reaching out, the files are committed to the repository and to be sure i downloaded the build in an artifact and checked that the files are where there where expected. what I am not sure though is if this part of the path is correct: "/opt/atlassian/pipelines/agent/build'

 

any help would be greatly appreciated as we still don't have a resolution 

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 26, 2024

Hey @sschroders ,

The path "/opt/atlassian/pipelines/agent/build" is the default build path of pipelines, and where pipeline will clone your repository during the build setup.

In order to confirm if the files are indeed there, could you add the following ls command in your pipeline step and check if the files are there ?

ls -LaR

This should print the directory structure and all the files inside it recursively.

Like sschroders likes this
sschroders August 26, 2024

@Patrik S Thanks for the help this helped me find what was wrong :) the folder name, in the repo was with small letter Test data and in the test with capital Test Data

Like Patrik S likes this
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 26, 2024

Awesome! Glad to have been of some help @sschroders !

If you ever need help in the future, feel free to reach out :)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events