Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Add videos to test runs in CircleCI #1387

Merged
merged 34 commits into from
Aug 7, 2018
Merged

Add videos to test runs in CircleCI #1387

merged 34 commits into from
Aug 7, 2018

Conversation

bsessions85
Copy link
Contributor

@bsessions85 bsessions85 commented Aug 2, 2018

This PR adds recording of test runs when run in CircleCI. All runs are recorded, but passing runs are deleted so that there aren't a bunch of useless videos. The videos are named after the step in which the test failed, similar to screenshots.

Here is a build where I added some intentional test failures- https://circleci.com/gh/Automattic/wp-e2e-tests/21836

Here is an example video - https://21836-57936731-gh.circle-artifacts.com/1/home/circleci/wp-e2e-tests/screenshots/videos/can-see-the-correct-blog-url-displayed-2018-08-03T18-54-20.mpg

Testing this one requires getting tests to fail in CircleCI. I have done that in the links above, but it would also be good to check that tests pass and fail as expected when run locally, even though videos will not be created.

Please let me know if you see any room for improvements or have any questions!

Copy link
Contributor

@brbrr brbrr left a comment

Choose a reason for hiding this comment

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

Awesome work, Brent!
I left a few minor comments, but they are more like personal preference.

One thing that bothering me - is the execution time. Looks like it is increased for ~2 min: 11:01 vs 8:59

looks like run-wrapper.sh used only in this repo, but I think should be careful not to affect canaries and/or e2e-tests-for-branches without need.

}

export function startDisplay() {
if ( process.env.TEST_VIDEO === 'true' ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Using guard clause, in this case, will remove not needed nesting which IMO more readable

}

export function startVideo() {
if ( process.env.TEST_VIDEO === 'true' ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

}

export function stopVideo( currentTest = null ) {
if ( process.env.TEST_VIDEO === 'true' ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

@bsessions85
Copy link
Contributor Author

@brbrr I think the delay is more an issue with tests that are re-tried. Of course I can't get a smooth run with no retries when I want to, but when desktop tests ran without issues, that finished in 9:22, which is right where I would expect it with 15-20 seconds of overhead for installing ffmpeg.

@bsessions85
Copy link
Contributor Author

Updated to use guard clauses as suggested by @brbrr

Copy link
Contributor

@Stojdza Stojdza left a comment

Choose a reason for hiding this comment

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

This looks really nice, it will be much helpful. Great work! 👍

@bsessions85 bsessions85 merged commit df86a84 into master Aug 7, 2018
@bsessions85 bsessions85 deleted the try/video-recording branch August 7, 2018 20:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants