Can you unit test pipeline code in github actions? - testing

I can't find a lot of info on this but basically I would like to replicate this on a github workflow. In other words:
How can you write tests for custom actions you have developed in a GH workflow ?
if you use:
python => pytest
YAML => checks ?
nodejs => some of the marketplace actions do have tests on them already
bash => ???
I usually dont test my pipeline as code stuff, but somebody brought up the good old argument jenkins is better than GH because of testing, whatever that means

I think this is the closest I can get. if I'll have to validate inputs I could use The GitHub ToolKit for developing GitHub Actions, where I can achieve unit testing in typescript. Couldn't find anything related to python that is actually not supported by github. However, I really don't think it matters since typescript will achieve what I want. I'm open to other ideas if this is wrong
some useful links:
Create your own github action
JS and PR checks
UPDATE:
Looks like my initial response wasn't that far from the truth. Here's a good explanation on all types of testing for github actions
Testing JS GH actions
Using Typescript

Related

How to run E2E test with Cypress if backend and frontend are on different repos?

I have a React frontend and a Node backend, I've made several E2E tests with Cypress for the frontend and run them locally. I love how end to end testing allows me to catch errors in the frontend as well as on the backend! so I'd like to have a way to run them automatically when sending a PR.
I'm using bitbucket pipelines, and I've configured it to run the npm test command which works perfectly to run my unit tests, but what I still don't understand is how to be able to run my Cypress tests automatically, because I'd need to have access to the backend repository from my pipeline that runs on the frontend repo.
What I've tried
I've read the documentation and played with the example repo, but I still don't understand how could I automate running my tests, on the example both backend and frontend are on the same repository.
I'm sorry if this is a vague question, I just don't seem to get if this is even possible with bitbucket pipelines, if it's not, what other tool could help me run my Cypress test in a similar way that I do locally? (running both backend and frontend).
I've really tried to search for an answer to this, maybe it's too obvious and I'm just missing something but I don't seem to find anything on the internet about this, any help will be very appreciated!
When your frontend and backend are versioned in different repositories, then you have to check out at least one of the two repositories (e.g. the other for which the pipeline is not currently being executed) during the pipeline execution to get access to the code and thus have the possibility to start frontend and backend together locally to run your tests.
This question has also already been asked and answered here:
https://community.atlassian.com/t5/Bitbucket-questions/Access-multiple-Bitbucket-repositories-from-a-single-Pipeline/qaq-p/1783419

Should I test a minified production build with cypress?

I'm testing a meteor app (with React.js as client) with cypress.
I'm willing to create a CI/CD script which will execute my cypress tests, but I think I am missing a point; how will cypress test my app with a production version of my app running, meaning with minified code ?
I saw that best practices were to provide data-* attributes as selectors for my elements, but this is pointless if every value is going to be minified.
I believe this is the wrong approach since I didn't see any question here about that.. But maybe someone can help me understand why ?
Thanks in advance !

How to integrate TestRail with Jest tests?

I'm running Jest integration tests on Jenkins and I want to integrate them with TestRail in order to automatically put test results to TestRail. In this way I will know easily how many tests are passed/failed?
Does anyone tried that?
I guess you are looking for something like this one https://github.com/zeljkosimic95/Jest-2-Testrail . Although your question is too old but it might help someone else. This is not official plugin but it may help you.
Adding a suggestion here, we should choose the tool after analyzing all the requirements in your software testing services and product. Because there is no official plugin for this except this https://gitlab.com/craydent/jest-testrail (haven't tried). But you still can do this without plugin with this library/code https://github.com/zeljkosimic95/Jest-2-Testrail
You can probably have a look at Agiletestware Pangolin solution which allows you to export results of your tests into TestRail automatically from popular CI systems.
In order to be able to upload test results, Pangolin requires you to create report in JUnit format which can be done by using https://github.com/jest-community/jest-junit
Disclaimer: I'm a developer of Agiletestware Pangolin

How can you generate test logs for functional tests on SoapUI?

Are there any plugins available for this? Does SoapUI offer plugins/addins anyway?
Thank.
It is not clear what you are asking.
SoapUI generates a soapui.log by default in the current working directory. Basic information is available in the official documentation, under the heading "Tip 7) Read the Log".
As for plugins: yes there are plugins available, and described in the official documentation as well.
Update:
If you are after logs of all the calls you made, then you need to launch the test runner with the -a or -A switch. As always official documentation is available for launching from the GUI or CLI.
Don't actually know if SOAPUI has any kind of plugins. But you could create your own reporting structure, which would be really cool because you can customize it however you want to. In our project, we write the expected and update the actual values into the data sink and write the test status into the same, all using the groovy script :)

Any good command-line tools (for a build server) for validating websites?

My team creates a number of dynamic/data-driven websites. We use a CruiseControl.NET to download the code, create test data, run unit tests, and install each site into IIS for manual testing. However we haven't found a good tool (or tools) that can actually run through some simple tests of the websites, such as checking for broken links or invalid HTML.
Are there any good tools that we can incorporate into our build process to automate basic website testing? E.g. check for broken links, check for HTML/JavaScript/CSS coding errors, and so on? Load testing would be great too.
Looking for something totally generic; we don't need to write/record scripts for playback. Just something to cover the basics.
Thank you!
-James
For link checking you could always look at http://linkchecker.sourceforge.net/ if that isn't suitable they list other alternatives.
It also seems like it is an active project.
JSLint does javascript validation and there are two options for executing it via the commandline so that might be worth a look too http://www.jslint.com/