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

Failed attachment index.html to email

Shubhendu Pandey July 22, 2020

Hi 

I am getting "Failed to add an attachment. No such file index.html" error 

This is my bitbucket-pipeline.yml file code

custom: # Pipelines that can only be triggered manually
QA2: # The name that is displayed in the list in the Bitbucket Cloud GUI
- step:
image: openjdk:8
caches:
- gradle
size: 2x # double resources available for this step to 8G
script:
- cd config/geb
- ./gradlew -S clean browerstackchTest
- echo "Manual trigger for QA2!"
after-script: # on failed builds send notifications to e-mail lists in addition to the committer
- if [ "${BITBUCKET_EXIT_CODE}" == "0" ]; then exit 0; else echo "gradle build step failed"; fi
- pipe: atlassian/email-notify:0.3.11
variables:
<<: *email-notify-config
TO: 'email@email.com'
SUBJECT: "Test result"
BODY_PLAIN: |
Please find the attached test result report to the email.
ATTACHMENTS: 'index.html'

 

I see it recognizes the report path 

* What went wrong:Execution failed for task ':browserstackchromeTest'.> There were failing tests. See the report at: file:///opt/atlassian/pipelines/agent/build/config/geb/build/reports/browserstackchromeTest/tests/index.html

 

1 answer

1 accepted

0 votes
Answer accepted
Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 22, 2020

Hi @Shubhendu Pandey ,

thank you for your feedback!

Try to provide full path to the index.html file instead of the filename only:

ATTACHMENTS: reports/browserstackchromeTest/tests/index.html

 

Shubhendu Pandey July 22, 2020

Hi @Oleksandr Kyrdan 

Thank you for your reply.

ATTACHMENTS: reports/browserstackchromeTest/tests/index.html

 Above is not working, I am getting the same error i.e "Failed to add an attachment. No such file index.html"

I also tried below things 

ATTACHMENTS: build/reports/browserstackchromeTest/tests/index.html
ATTACHMENTS: 'reports/browserstackchromeTest/tests/index.html'

But no luck so far 

Here is screenshot of error message 

screenshot17_39_20.png

-----------------------------------------------------------------------------------------------------------------------------------

Question:- Do I have to first create artifact in order to access this file?

Oleksandr Kyrdan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 22, 2020

@Shubhendu Pandey oh, you have two build directories in your path, then try:

ATTACHMENTS: config/geb/build/reports/browserstackchromeTest/tests/index.html

 
Note! /opt/atlassian/pipelines/agent/build/ is step's work directory.
Value stored in the variable BITBUCKET_CLONE_DIR.

Shubhendu Pandey July 22, 2020

@Oleksandr Kyrdan 

That worked 

Thank you! You are awesome.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events