-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore: [NO-JIRA] update lib to latest from upstream #2
Conversation
@olga-govor can you please advise on how to publish these changes? |
@@ -0,0 +1,35 @@ | |||
describe('Delete pizza', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need all that example tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used for local test validation of cypress plugin. It is not supposed to be included in the published distribution of the package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, but if we decide to keep tests then we need to setup ci/cd for it and also add tests for customisation
@oxscott I would say first we need to clean up this PR - it contains a lot of unnecessary staff that is presented in parent lib only as an example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeremiah-snee-openx we won't merge this as this edition contains a lot of code that we don't use and we won't use - it's an example in parent repo. If we need to update cypress version let's update cypress version, but do not change name of package, etc.
Also if we want to update with original changes in libs and also do some functional changes - it should be splitted on separate PR's - as for now it's not understandable what is from parent lib and what was updated by you and why?
Changes in this lib will affect UI tests in ui-unity and ui-tests, so we can't do it in such way
And sorry, but changes in lib that is widely used should have JIRA ticket with clear description what do we change and why
"version": "0.2.3", | ||
"description": "Reduce up to 40% your Cypress suite execution time parallelizing the test run on the same machine.", | ||
"main": "cli.js", | ||
"name": "cypress-parallel-dev", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to change name of package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apologies if my question was not clear. we could not find docs on how to contribute/test changes here and i was asking how to publish this so that testing can take place. i presume cypress-parallel-dev
was chosen to avoid naming conflicts with cypress-parallel
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we want to test new package we can locally connect our repo with tests to locally update cypress-parallel plugin, to have brief view if everything is ok.
After if everything is ok, new version of plugin can be published (https://docs.npmjs.com/creating-and-publishing-private-packages), but it would be good to have
"@openx/cypress-parallel": "0.2.3"
instead of "@openx/cypress-parallel": "^0.2.3"
, so it won't be updated by somebody unintentionally
Switch test branch in ui-unity to new version of plugin and run the whole regression.
@olga-govor why wouldn't we just keep this fork in sync with upstream and layer on our customization? wouldn't that be easier than picking and choosing specific updates to reimplement? edit: or even better would be to drop the fork and contribute directly to upstream with our customizations since it just looks like some additional settings for weights files and timeouts. out of scope for this pr, but something to consider in the future. |
@oxscott if you will take a look at package itself https://www.npmjs.com/package/cypress-parallel?activeTab=code it contains just code from lib folder. Also lib folder organise as separate project (it's own package.json, etc) and actually it's cypress-parallel plugin, so if we want to be up-to date with up-stream we need to sync only one lib folder. Regarding contribute to open-source library - it's good idea, but it will take time and need separate capacity on it. Also we need to clarify legal part of commiting our work to open-source (do OpenX allow it) |
@@ -37,7 +43,7 @@ async function start() { | |||
const end = new Date(); | |||
const timeTaken = end.getTime() - start.getTime(); | |||
|
|||
const resultsPath = path.join(process.cwd(), settings.runnerResults); | |||
console.log(`Reading results from ${resultsPath}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both in upstream and in master we create variable resultsPath and use it further, why you decided to change this logic ?
@@ -6,7 +6,11 @@ const path = require('path'); | |||
const fs = require('fs-extra'); | |||
const { settings } = require('./settings'); | |||
|
|||
const { getTestSuitePaths, distributeTestsByWeight } = require('./test-suites'); | |||
const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we want to have easy
keeping up-to-date with parent then it's better not to restyle upstream code
@@ -31,12 +31,13 @@ function createReporterOptions(string) { | |||
} | |||
|
|||
function createReporterConfigFile(path) { | |||
const reporterEnabled = ['@openx/cypress-parallel/json-stream.reporter.js']; | |||
console.log('Creating reporter config file', __dirname); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this console log? it's more difference with upstream that is not necessary
@@ -51,7 +52,7 @@ function createReporterConfigFile(path) { | |||
} | |||
|
|||
function createCommandArguments(thread) { | |||
const specFiles = `${thread.list.map(path => globEscape(path)).join(',')}`; | |||
const specFiles = `${thread.list.map((path) => globEscape(path)).join(',')}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do need this stylish change?
@@ -80,7 +81,7 @@ async function executeThread(thread, index) { | |||
const commandArguments = createCommandArguments(thread); | |||
|
|||
// staggered start (when executed in container with xvfb ends up having a race condition causing intermittent failures) | |||
await sleep(index * 5000); | |||
await sleep((index + 1) * 2000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was intentional increase as 2sec was insufficient time
} catch(e) { | ||
console.error(e) | ||
console.log('Weights file generated under path: ' + weightPath); | ||
} catch (e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same: let's keep style as in upstream to not produce additional difference
Also as a temporary solution till we decide contribute to open-source or totally separate it and bring tests,ci/cd, etc to life we can use just shell script to update our package with upstream changes
|
at this point i think it will be easier to just cut a branch of ui-unity that uses the up-to-date public package. this would allow for testing with an up-to-date if the test is successful, we can decide how to either 1) get this forked codebase up-to-date or 2) just switch unity over to the public package (once stability has been proven). if the test is not successful, then we can leave the tech debt work in this private package for another day while we focus on the primary objective of fixing hanging test jobs. |
@olga-govor The only thing that should be published from this repo is the lib folder. The name of the package is the same. cypress-parallel/lib/package.json Lines 2 to 4 in a96200c
The example files in cypress directory are used for testing of the package, but not a part of the distribution. |
@jeremiah-snee-openx yes, but it doesn't answer why we need to change name in base project: |
@oxscott
May I ask what is the exact change in upstream that probably fix the problem? |
@olga-govor the list of updates/improvements is long. you can read through them here. weights file location setting was added here. staggered thread delay was added here. it's not easy to see what else has changed based on the commits straight to given that this plugin handles cypress's paywalled parallelism feature for us, it seemed like a reasonable troubleshooting step to try using the latest version which includes a list of bug fixes and dependency updates, some of which relate to thread management or caching. i didn't expect it to be so disruptive, so i'm suggesting we test these updates using the public package for now before continuing conversation on this PR. |
@oxscott I asked not about improvements that were done in upstream, but improvements that were done by @jeremiah-snee-openx (because there are some changes). |
Changes not from upstream were to fix issues seen in ci testing pipeline related to changes from OpenX Code changes. Was able to find and resolve cypress hanging issues in |
Merge update from upstream.