-
Notifications
You must be signed in to change notification settings - Fork 2.4k
add script to test prs #2790
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
add script to test prs #2790
Conversation
|
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/codesandbox/codesandbox-client/5jsxr6tfr |
testpr-script.js
Outdated
| const branchName = `pr-${username.sync()}-${prId}`; | ||
|
|
||
| exec( | ||
| `git fetch origin pull/${prId}/head:${branchName}`, |
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.
@christianalfoni This wont work on forks I guess? 🤔
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 is for forks :) Take a look at: #2787 , the comments
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.
I mean if I run locally yarn test:pr 2787 this wont work, since my origin is my own fork of the repo and my upstream is the original repo
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.
Oh, I see :) Yeah, the intention was that the devs who merge into master has a chance to verify the PR before they do so :)
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 it's only for CodeSandbox-people, my comment is obsolete 😉
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.
I did not want to use the term Codesandbox-people, hehe... "merge people" 😂
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.
Same people, different name 😉
testpr-script.js
Outdated
| .then(() => spawnPromise('yarn', ['install']).then(() => { | ||
| return spawnPromise('yarn', ['build:deps']); | ||
| })) | ||
| .then(() => spawnPromise('yarn', ['build:deps'])) |
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.
But what if they are changed? 🤔
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.
You will get an error either building when you start the project or when building the deps :) Just as you normally do
Allows you to easily test a PR:
Note the number of the PR, in this example:
2787In the root of client run:
yarn test:pr 2787It will automatically checkout the PR and update and build the deps. This is just to ensure the environment is correct related to testing.
If you want to make changes you can do so by:
I think this creates a really good collaborative feeling for the contributor. We are helping them helping us, instead of overriding what they are doing.