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

[full-ci] feat(smoke tests): automated parallel smoke tests #5675

Merged
merged 3 commits into from
Sep 3, 2021

Conversation

fschade
Copy link
Contributor

@fschade fschade commented Aug 15, 2021

This PR introduces a first step to have automated smoke tests.

To get a better understanding what that is, what not and how this could be useful pleas read the README.md

It introduces new concepts how and where tests are running.
It's not a final solutions, instead it's just a starting point and needs to be extended if agreed to go that road.

Things that not there yet:

  • Persona does not include all smoke tests
  • runs only local, Drone setup is yet not there

@fschade fschade added Type:CI Related to our Continouus Integration Solution QA:testing labels Aug 15, 2021
@update-docs
Copy link

update-docs bot commented Aug 15, 2021

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@ownclouders
Copy link
Contributor

Results for oC10MoveUpload https://drone.owncloud.com/owncloud/web/18295/14/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@ownclouders
Copy link
Contributor

Results for oC10iPhone1 https://drone.owncloud.com/owncloud/web/18296/45/1
The following scenarios passed on retry:

  • webUIDeleteFilesFolders/deleteFilesFolders.feature:59

@ownclouders
Copy link
Contributor

Results for oC10XGAPortrait2 https://drone.owncloud.com/owncloud/web/18296/43/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@phil-davis
Copy link
Contributor

I see that this uses Playwright as the framework for accessing the browser. That moves away from Nightwatch.

We already started making some user-journeys. They are currently in the Nightwatch-based test suite.

It is easy to add whatever scenarios we want to the Nightwatch-based test suites. We can add to the user-journeys, or we can make another test suite for "basic smoke tests for local development" or we can add and choose scenarios anywhere through the test suites and put some tag on them so that they can be easily run.

There is a lot of duplication in having both Nightwatch and Playwright running scenarios that require the same knowledge of how to create a user, group, of the element ids on pages and so on.

What are the thoughts/reasons for moving from Nightwatch to Playwright?

If Playwright has significant advantage compared to Nightwatch, then should we switch all the UI tests to Playwright?

@ownclouders
Copy link
Contributor

Results for oC10IntegrationApp2 https://drone.owncloud.com/owncloud/web/18319/66/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@fschade
Copy link
Contributor Author

fschade commented Aug 16, 2021

I see that this uses Playwright as the framework for accessing the browser. That moves away from Nightwatch.

We already started making some user-journeys. They are currently in the Nightwatch-based test suite.

It is easy to add whatever scenarios we want to the Nightwatch-based test suites. We can add to the user-journeys, or we can make another test suite for "basic smoke tests for local development" or we can add and choose scenarios anywhere through the test suites and put some tag on them so that they can be easily run.

There is a lot of duplication in having both Nightwatch and Playwright running scenarios that require the same knowledge of how to create a user, group, of the element ids on pages and so on.

What are the thoughts/reasons for moving from Nightwatch to Playwright?

If Playwright has significant advantage compared to Nightwatch, then should we switch all the UI tests to Playwright?

Thanks for you input, it started to be a poc and at the end worked out really nice.
Playwright has a totally different concept then selenium of how it is automating the browser.

This has a lot of benefits, for example there are rare cases where a manual wait is needed.
I see this as a POC which eventually can evolve over time. It should not test everything like we do in our mature acceptance test. Instead it's a tiny piece which fills the gap of quick, local testing before the code hits the ci.

@fschade fschade changed the title feat(smoke tests): Introduce dedicated automated smoke tests feat(smoke tests): automated parallel smoke tests Aug 19, 2021
@ownclouders
Copy link
Contributor

Results for oC10XGAPortrait1 https://drone.owncloud.com/owncloud/web/18463/42/1
The following scenarios passed on retry:

  • webUIDeleteFilesFolders/deleteFilesFolders.feature:59

@ownclouders
Copy link
Contributor

Results for oCISSharingInternalUsers1 https://drone.owncloud.com/owncloud/web/18463/55/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@ownclouders
Copy link
Contributor

Results for oCISLocks https://drone.owncloud.com/owncloud/web/18796/48/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@ownclouders
Copy link
Contributor

Results for oCISFiles2 https://drone.owncloud.com/owncloud/web/18796/53/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@ownclouders
Copy link
Contributor

Results for oCISSharingPublic https://drone.owncloud.com/owncloud/web/18796/61/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

ocis and oc10 bdd smoke tests are now able to with playwright and in parallel,
this means running tests with many users at the same time are now possible.
Sessions won't conflict, this introduces a whole new level of test possibilities and speed
@ownclouders
Copy link
Contributor

Results for oC10iPhone2 https://drone.owncloud.com/owncloud/web/18806/46/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@pascalwengerter
Copy link
Contributor

Rebased and fixed a minor CI issue, in favor of merging this and building on top/updating the (currently WIP/draft documentation)

Copy link
Contributor

@pascalwengerter pascalwengerter left a comment

Choose a reason for hiding this comment

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

Lovely!

}

export const checkResponseStatus = (response: Response, message = ''): void => {
// response.status >= 200 && response.status < 300
Copy link
Contributor

Choose a reason for hiding this comment

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

Dev leftover?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

think yes, should be fine to get rid of it

import fetch, { BodyInit, Response } from 'node-fetch'
import { User } from '../types'
import { config } from '../config'
import _ from 'lodash'
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use lodash-es here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we could but there it doesnt matter, does not get packed

@pascalwengerter pascalwengerter changed the title feat(smoke tests): automated parallel smoke tests [full-ci] feat(smoke tests): automated parallel smoke tests Sep 2, 2021
@pascalwengerter pascalwengerter force-pushed the add-smoke-tests branch 2 times, most recently from 15a4a71 to a9bae68 Compare September 2, 2021 16:17
@phil-davis
Copy link
Contributor

phil-davis commented Sep 2, 2021

https://drone.owncloud.com/owncloud/web/18812/7/8

error [email protected]: The engine "node" is incompatible with this module. Expected version ">= 14.17.0". Got "8.17.0"

That is surprising - this branch is rebased to the latest master.

I suspect that to move to the later CORE_COMMITID we need to use the "new" owncoudci/core:nodejs14 docker image, like is done in core PR owncloud/core#39141

@pascalwengerter
Copy link
Contributor

https://drone.owncloud.com/owncloud/web/18812/7/8

error [email protected]: The engine "node" is incompatible with this module. Expected version ">= 14.17.0". Got "8.17.0"

That is surprising - this branch is rebased to the latest master.

From my understanding it lacks the node14-based core img, see latest commit 😉 and error msg in CI https://drone.owncloud.com/owncloud/web/18785/14/9

@phil-davis
Copy link
Contributor

@pascalwengerter I updated my post while you were making yours.

This needs changes like in core PR owncloud/core#39141

Should we do a separate PR here in web for that, and not mix it up with this, or?

@pascalwengerter
Copy link
Contributor

pascalwengerter commented Sep 2, 2021

@pascalwengerter I updated my post while you were making yours.

This needs changes like in core PR owncloud/core#39141

Should we do a separate PR here in web for that, and not mix it up with this, or?

This is where I got my inspiration from! Let's see how CI goes, I'm highly in favor of merging this if it gets green to not waste even more time waiting for it to pass

Edit: The commit + core-nodejs changes are in a separate commit and will show up in the git history accordingly

@ownclouders
Copy link
Contributor

Results for oC10SharingPublicManagement https://drone.owncloud.com/owncloud/web/18815/34/1
The following scenarios passed on retry:

  • webUISharingPublicManagement/publicLinkIndicator.feature:27

@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 3, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QA:testing Type:CI Related to our Continouus Integration Solution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants