Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the singleRun parameter to group all results into a single testrail run #31

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Mastermindzh
Copy link

Hey,

By default this reporter creates multiple runs for every .spec file that is ran through cypress.
This results in a LOT of runs in Testrail In our test project we already have 3 runs based on the 3 simple test files:
image

With this change, if people add the singleRun: true parameter to the reporter options it will all be grouped into a single run instead:
image

This makes, i.m.o, the runs way smoother.

Everything should be backwards compatible so I only increased the minor version.

In doing this I also did some other stuff:

  • Fixed the bug that when you give a directory to cypress' --spec argument it would always close the run after the first file (because it found 0 files)
  • Added prettier & editorconfig to make it easier for contributors to follow sane code styles. (I either took defaults or fitted it to existing code)
  • Cleaned up some scoping issues of variables.

…'t split on spec files

- Added [editorconfig](https://editorconfig.org/) and [Prettier](https://prettier.io/)
  - cleaned up some code
@Mastermindzh
Copy link
Author

@HBTeun, @pascal89, @AimedNuu

Could you guys please have a look at the code as well :)

@HBTeun
Copy link

HBTeun commented Aug 4, 2022

@Mastermindzh Although I think adding the editorconfig and prettier files is a good thing, it distracts from the real code changes. Maybe split the PR or move it to it's own commit so you can ignore the style changes.

.prettierrc.js Outdated
@@ -0,0 +1,43 @@
odule.exports = {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing the m here?

@val-andrushko
Copy link

@Mastermindzh Could you explain this a little bit?

This makes, i.m.o, the runs way smoother.

Will this make them run faster or just reduce amount of "spam" results in Testrail?

@tlei123
Copy link

tlei123 commented Aug 6, 2022

Does anyone know why/how the /dist folder's now being tracked? Aren't all the files inside just outputs from /src/lib source files?

@Mastermindzh
Copy link
Author

@AimedNuu, Less spam. It doesn't affect speed.
Without these changes the reporter will create a new run for every spec,test,cy file that has been processed. It will also close the run so that it can't be updated anymore.

Thus... for 3 test files (which our example project has) there were 3 test runs (something like 60%-20%-20%, making 100% alltogether) instead of 1 that totalled 100%. *

  • We also send along the "includeAllInTest" so that all testcases are in a testrun, so less than 100% is still possible if the cypress tests don't 100% cover the test cases in Testrail.

@tlei123,

I can confirm that it is being built from the src/lib files. There is (probably) no reason to include them here.
The only reason one would ever want to host them on Github is for url-based consumption (like deno does), which as far as I can see isn't the case here.

@val-andrushko
Copy link

I have nothing to add to the code here. But it was not a nice review experience due to editoconfig style fixes mixed with the actual code change : /

@val-andrushko
Copy link

Does anyone know why/how the /dist folder's now being tracked? Aren't all the files inside just outputs from /src/lib source files?

I see no particular reason for that. Seems like it was never added to the .gitignore.

@Bryan-kile1
Copy link

@Mastermindzh this pr will be incredibly helpful if merged and approved. One end user note would be to specify the expected string values in the README for singleRun to specify it's true to false and not only a string. This would match the documentation structure that already exists in the project.

disableDescription: bool (optional: default is false) possibility to disable description for test run in case that someone don’t have cypress dashboard feature (disableDescription: true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants