-
Notifications
You must be signed in to change notification settings - Fork 26
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
Local visreg #60
Local visreg #60
Conversation
I'm going to keep dumping more and more review related commits here, and try to never force push. When it looks good to squash, I'll close this PR and open |
At a minimum draw a picture (architecture diagram) of the different pieces and what kinds of input are required/used. |
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.
Zoom LGTM
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.
From the PR review yesterday.
@@ -0,0 +1,13 @@ | |||
export interface IConfig { |
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.
Comment on all of this stuff.
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.
Including the fact that this isn't run because it needs to be copied first.
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.
test/bin/visreg.ts
Outdated
|
||
const storedToken: any = fs.existsSync(f) && fs.readFileSync(f); | ||
const token = (storedToken || (await password("github PAT: "))); | ||
const repoUrl = url.parse(`https://github.rackspace.com/${config.githubName}/${config.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.
Use the config here.
test/bin/visreg.ts
Outdated
`cd ${config.screenshotsDirectory}`, | ||
`git add -A`, | ||
`git status -sb`, | ||
`git commit -m "Baseline"`, |
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.
Better commit message?
test/index.ts
Outdated
}); | ||
}); | ||
|
||
describe.skip("firefox", () => { |
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.
Undo this.
test/scripts/webdriver-start
Outdated
@@ -0,0 +1,6 @@ | |||
#!/usr/bin/env bash | |||
|
|||
java -Dwebdriver.gecko.driver=bin/selenium/geckodriver \ |
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.
Document this.
test/scripts/webdriver-update
Outdated
|
||
wget -nc -q https://{GH_TOKEN}@github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-${platform_gecko}.tar.gz -O bin/selenium/geckodriver-v0.18.0.tar.gz | ||
wget -nc -q https://chromedriver.storage.googleapis.com/2.31/chromedriver_${platform_chrome}.zip -O bin/selenium/chromedriver_2.31.zip | ||
wget -nc -q https://selenium-release.storage.googleapis.com/3.4/selenium-server-standalone-3.4.0.jar -O bin/selenium/selenium-server-standalone.jar |
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.
Document this too (brew install wget
).
test/bin/visreg.example.config.ts
Outdated
|
||
export var config: IConfig = { | ||
"githubEmail": "andrew.yurisich@rackspace.com", | ||
"githubName": "andr6283", |
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 needs a github hostname.
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.
Also, consider removing my personal information and instead leave it blank or use an obviously fake account for info.
test/bin/visreg.ts
Outdated
]; | ||
return safeExecSync(cmds.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.
All of these anonymous util functions can be brought out into it's own file and exported.
329a642
to
7318eef
Compare
https://github.com/rackerlabs/helix-ui/wiki/Testing updated Looking to close this and open the squashed version of this. Should I be squashing this down to just one commit, @CITguy? |
029a500
to
7d14b01
Compare
test/bin/_visreg.ts
Outdated
@@ -0,0 +1,232 @@ | |||
/* |
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.
Rename to util.ts
to match common javascript module naming convention.
test/scripts/webdriver-update
Outdated
#!/usr/bin/env bash | ||
|
||
# https://stackoverflow.com/a/4785518/881224 | ||
which wget >/dev/null 2>&1 || { echo "Install wget. Try 'brew install wget' on mac. Aborting." >&2; exit 1; } |
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.
Generalize the message to be less system-specific.
test/scripts/webdriver-update
Outdated
wget -nc -q https://selenium-release.storage.googleapis.com/${TARFILE_STANDALONE} -O bin/selenium/selenium-server-standalone.jar | ||
tar -xzf bin/selenium/geckodriver-v0.18.0.tar.gz -C bin/selenium/ | ||
unzip -o bin/selenium/chromedriver_2.31.zip -d bin/selenium/ | ||
cd node_modules/.bin/ && ln -s ../../bin/selenium/* . |
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.
Add comment about why this is needed.
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.
Will it be a problem if things are already symlinked?
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.
No because the script starts by removing them first.
test/bin/_visreg.ts
Outdated
export const repoUrl = url.parse(`https://${config.githubHostname}/${config.githubName}/${config.repo}`); | ||
export const hasCommitRegex = /\[.*([0-9a-f]{7})] Checking in screenshots.../; | ||
|
||
export async function getBranchName(targetBranch: string) { |
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.
maybe rename to askBranch
?
test/bin/_visreg.ts
Outdated
return branch; | ||
} | ||
|
||
export async function getGithubToken() { |
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.
maybe rename to askGithubToken
?
test/bin/_visreg.ts
Outdated
} | ||
|
||
if (unknownError) { | ||
throw new Error("Something has gone very wrong " + afterCommitData); |
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 no template literal?
test/bin/_visreg.ts
Outdated
}; | ||
|
||
export function buildCurlFlags(token: string) { | ||
const flags = [ |
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.
Can you use a multi-line template literal?
test/bin/_visreg.ts
Outdated
res.on("data", d => { data.push(d.toString())}); | ||
if (res.statusCode !== 201) { | ||
res.on("end", () => { | ||
const msg = `(HTTP ${res.statusCode}) Something went wrong while creating the repository ${repoUrl.href}:\n${data.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.
This might be useful as a multi-line template literal.
test/bin/_visreg.ts
Outdated
}; | ||
|
||
function commitScreenshots(token: string, screenshotsDirectory: string) { | ||
let cmds = [ |
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.
Can this be a multi-line template literal?
test/scripts/webdriver-start
Outdated
|
||
# https://stackoverflow.com/a/4785518/881224 | ||
LINK="https://github.com/rackerlabs/helix-ui/wiki/Testing#java" | ||
which java >/dev/null 2>&1 || { echo ${LINK}; echo "Install java. Try 'brew install java' on mac. Aborting." >&2; exit 1; } |
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.
Generalize the message to be less system-specific.
9863439
to
bb0b3c2
Compare
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.
Dev LGTM
We know it's a work in progress, but this looks good enough for the first iteration.
JIRA: https://jira.rax.io/browse/SURF-616
Not sure if a Design LGTM is called for here but I can at least get a demo put together for designers during a zoom review.
You can run this by navigating into the
test
directory, runningyarn install
, thennpm run visreg {branchName}
.I'll demo it in better detail during the zoom review.
LGTM's