Is there a way to inspect build dir xml-data from bamboo ui - bamboo

Is there a URL path that bamboo UI exposes which allows you see browser the contents of the build dir ?
All I can see is the url to logs but nothing for the build dir.

Not directly.
You can configure the directory as a job artifact, then it will show up in the UI in the artifacts tab. In this case the URL would be http://myserver/bamboo/browse/MYBUILD/latest/artifact
Alternatively, you can run ls from within your build and see the contents in the build log. If not already so, you can add a script task to your job for the purpose.

Related

NYC instrument lcov report source path - where does it come from?

I'm instrumenting code in one docker container, and run the tests in another docker container.
Right now in the test docker container, I create folder so they match the container where I build the code.
However, it would be much easier, if I could just set the path, but I'm struggling to find out where / how to set the path.
I'm talking about this here:
As you can see in the screenshot, the path for the source files is set to /src/* and I have no idea where this comes from. When I instrument the code, I'm not in that directory, I'm in an app folder, like this: /apps/angular14/node_modules/testpackage with the arguments --in-place=true --exclude-node-modules=false
I found the path ../../src in the build files of the app and overwrote it, but it didn't matter. Where does the code coverage report logic take the information from, and is there a way to set this manually, like an environment variable or an argument to nyc instrument?

Testcafe - How to set relative instead of absolute screenshot path in reports

I'm using spec and xunit reports. My .testcaferc.json is:
{
"screenshotPath": "artifacts/screenshots",
"takeScreenshotsOnFails": true,
"screenshotPathPattern": "${DATE}_${TIME}/${USERAGENT}/test-${TEST_INDEX}.png"
}
When the test failed in the spec and xunit reports shows the link to the screenshot, but that link has an absolute path. That is ok when I run tests locally. When running in Jenkins CI/CD the publish xunit report can't find the screenshot using absolute path due to using a relative path from "workspace" folder. Is there any way to config Testcafe to put the relative path into testRunInto.screenshotPath. I need a relative path to screenshots for any report providers.
Upd: I'm using a Jenkins Agent server to run test. The absolute path to workspace in this case: /home/jenkins/workspace/e2e. Screenshoots located in relative path: artifacts/screenshots or absolute path /home/jenkins/workspace/e2e/artifacts/screenshots. In xunit report (or any other) we got an absolute path for the screenshots. When all test finished Jenkins Agent push the whole workspace to the Master Jenkins server and absolute path to workspace became: /home/jenkins/job/test/ws/e2e and path to the screenshots: /home/jenkins/job/test/ws/e2e/artifacts/screenshots. Then Jenkins post-build action publish "Junit test result report". But inside that report we have the absolute path to the screenshot came from Jenkins Agent Server. As a result Master Jenkins unable to find the screenshot when shows the test result report.
Previously I used to use Selenium and Maven or Gradle to run the test and there was a relative path to the screenshots.
At present, TestCafe does not have an option to use relative paths in reports. I've created a suggestion in the TestCafe repository for your case - https://github.com/DevExpress/testcafe/issues/3497. If this feature is important for you, then you can try to implement it yourself.
It is not difficult. You need to do following: add a new option (see an example here) and change the path resolving mechanism depending this option (see an example here).

How to group together certain tests or files when doing a run in Cypress?

I am currently running Cypress and I have folders inside of it, where I have tests located for different applications.
I have a folder entitled "smhw-qa" which contains sub-folders and tests files for this specific application.
This directory apps will also include other applications too in future.
What I wish to do
In order to avoid having to run every test for a run, I wish to only run this specific folder. The location of the folder is as such:
'cypress/integration/apps/smhw-qa'
Over time, there will be more folders and tests added to the apps directory.
I am familiar with how to run a specific file, so doing the following works:
npx cypress run --spec 'cypress/integration/apps/smhw-qa/banners_promos_global/global_search.js'
How can I specify to Cypress which folder to run specifically when I use the npx cypress -run command?
What I have tried already
To run a specific test file I tried:
npx cypress run --project 'cypress/integration/apps/smhw-qa'
But this provides an error instead:
Can't run because no spec files were found.
We searched for any files inside of this folder:
/Users/jaswindersingh/Documents/cypress-automation/automation/cypress/integration/apps/smhw-qa/cypress/integration
Running specific sets of tests by their folders will be much easier for me, and will save time when running a specific suite of tests on our CI platform for example. I will also not need to specify the individual files since this is time-consuming.
It would also mean I can split out my tests and run them on different machines
Do I need to put anything into my test files, or inside of cypress.json or modify anything else, or can this be achieved through the terminal?
What options must I use instead?
Thanks
I think the clue is in the error message, you call
cypress/integration/apps/smhw-qa
and the error message shows
cypress/integration/apps/smhw-qa/cypress/integration
so to use the --project flag you need to replicate the /cypress folder per project, as per this example cypress-test-nested-projects
Folder structure:
package.json
node_modules
src/
clients/
foo/
cypress.json
cypress/
bar/
cypress.json
cypress/
However, I think you might want to use the --spec flag instead. If I understand it correctly, the glob pattern will allow you to keep the current folder structure. Docs
cypress run --spec 'cypress/integration/apps/smhw-qa/**/*'
Through --project you can manage different cypress.json files, the docs says
This enables you to install Cypress in a top level node_modules folder but run Cypress in a nested folder. This is also helpful when you have multiple Cypress projects in your repo.
so you're on the right way, just prepare some project-related cypress.json files

Show HTML artifacts in bamboo without downloading

I've successfully created a small demo HTML report of test results from a build. Simply put, I'm doing numerical computations, and would like to give more detailed information on test results than a binary pass/fail. The HTML report consists of multiple HTML files with relative links between them.
However, linking to one file from the other sometimes leads to the file being opened in the browser, and sometimes a "download file" dialog opens. Any ideas what the rules are, so I can look at the whole report in-browser without resorting to downloading a zip file of the whole report, unzipping, etc etc?
Just a quick note here, if anyone should need it - as this was where I ended up in my search.
After upgrading our Bamboo to 6.8.1 build 60805 our code coverage artifacts started downloading, instead of being displayed inline.
This can be fixed by setting the Security and permission setting Allow artifacts to be embedded in Bamboo pages.
Be aware of the note about Cross-Site-Scripting vulnerabilities if enabled.
On our project we use this simple solution
1.In Stage configure final task script to copy reports to some folder:
echo "Copy artifact report"
rm -rf ../artifacts
mkdir ../artifacts
cp -r functionalTests/build/html/behat/* ../artifacts/
2.On Artifacts tab edit artifact definition and set Copy pattern to artifacts/**
Then when you navigate to build artifact then folder with reports will be opened in browser
To have an embedded html page in bamboo showing the coverage results, this page has partially helped me to make bamboo cooperate with python coverage:
Troubleshooting
The Clover tab shows the directory listing instead of the HTML report
Please check which artifact handler you use. The Amazon S3 Artifact
Handler serves files on a one-by-one basis, instead of exposing all
files as a static website. To change this, open Configure plan and on
the Miscellaneous tab select the Use custom artifact handler settings
check-box. Then select Server-Local Artifact Handler for shared and
non-shared artifacts and finally re-run the build.
In my setup though "Server-Local Artifact Handler" failed completely, but choosing "Bamboo remote handler" did the job.

publish selenium reports from jenkins

I run selenium scripts through maven.Please let me know how to publish selenium reports under post build actions in jenkins.I tried several options
Publish selenium report
publish selenium html report
publish HTML report
publish test ng reports
I tried giving full path from C drive where the surefire reports exist
C:\proj1\target\surefire-reports*.html
it says file *.html doesn't exist
and for html report-it says no report exist
tried giving workspace relative path as well but it provides empty report
In test results folder in excel sheet,I get the report the status of each testcase.But its not published in jenkins.
Could anyone please send me the exact tried out steps to publish reports from jenkins.
Publushing report with the publishHTML reports works with the repository. You should not type the file path
For example, I have on my projects the following as the endpoint for reports.
WebContent/build/Selenium/resultsTests/
Where of course resultsTests is my directory where I publish my reports.
Here is a screenshot of my config
You need to create a folder inside your job/workspace folder.
Example my job folder is C:\Program Files (x86)\Jenkins\jobs\Yahoo\workspace.
I created a folder named results
C:\Program Files (x86)\Jenkins\jobs\Yahoo\workspace\results.
I set Test Report HTMLs as results/.
You can check on the link right below the folder field:
Basedir of the fileset is the workspace root. <--- "The workspace root" is a link to your workspace so you can see your new folder there.
Follow below steps:
install html publisher plugin in your jenkins and restart post done
from your framework copy the path of the folder where reports are getting saved.
Example my path is : D:\workspace\rule\CurrentTestResult
In your Jenkins job, navigate to Post -build actions
In section "HTML directory to archive" give above path
Example : "D:\workspace\rule\CurrentTestResult"
And in index page[s], mention your file name, Or simply add "*.html"
In report title give any desired name
Apply and check