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

Expose option for using GitHub Checks #798

Merged
merged 2 commits into from Dec 27, 2018

Conversation

cysp
Copy link
Member

@cysp cysp commented Dec 27, 2018

Closes #765

@cysp cysp force-pushed the feature/github-checks-option branch from 4517e6a to 75bd23a Compare Dec 27, 2018
@@ -16,6 +16,10 @@ const defaultAppArgs: Partial<SharedCLI> = {
const source = new FakeCI({})
const platform = new FakePlatform()

beforeEach(() => {
mockRunDangerSubprocess.mockReset()
Copy link
Member Author

@cysp cysp Dec 27, 2018

Choose a reason for hiding this comment

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

Currently each assertion here is actually testing against the arguments passed into the first invocation of the danger runner, not the one that they've just performed.

Copy link
Member

@orta orta Dec 27, 2018

Choose a reason for hiding this comment

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

👍

@@ -38,3 +40,4 @@ export default (command: any) =>
.option("-c, --external-ci-provider [modulePath]", "Specify custom CI provider")
.option("-p, --process [command]", "[dev] Runs a custom sub-process instead of the Danger JS runtime")
.option("-u, --passURLForDSL", "[dev] Use a custom URL to send the Danger DSL into the sub-process")
.option("--use-github-checks", "Use GitHub Checks", false)
Copy link
Member Author

@cysp cysp Dec 27, 2018

Choose a reason for hiding this comment

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

Whaddayareckon?
I didn't dare try to come up with a single-character option for this.

expect(executor.platform).toEqual(platform)
expect(executor.options.disableGitHubChecksSupport).toEqual(true)
})

// TODO: This occasionally fails!
Copy link
Member Author

@cysp cysp Dec 27, 2018

Choose a reason for hiding this comment

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

I suspect that this intermittency was caused by the failure to reset the mock but I didn't want to muddy up this PR with that change. If you concur with that assessment I'll raise a PR unskipping this after the mock resetting has landed. 🙂

Copy link
Member

@orta orta Dec 27, 2018

Choose a reason for hiding this comment

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

This makes sense to me - good thinking!

orta
orta approved these changes Dec 27, 2018
Copy link
Member

@orta orta left a comment

Let's do it, I also don't have a better name, but I don't predict that too many folks will want to use checks after having used it for a while :D

expect(executor.platform).toEqual(platform)
expect(executor.options.disableGitHubChecksSupport).toEqual(true)
})

// TODO: This occasionally fails!
Copy link
Member

@orta orta Dec 27, 2018

Choose a reason for hiding this comment

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

This makes sense to me - good thinking!

@orta orta merged commit a05a340 into danger:master Dec 27, 2018
4 checks passed
@peril-staging
Copy link
Contributor

@peril-staging peril-staging bot commented Dec 27, 2018

Thanks for the PR @cysp.

This PR has been shipped in v7.0.1 - CHANGELOG.

@cysp cysp deleted the feature/github-checks-option branch Dec 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants