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
Being able to navigate to a PR page of an AppVeyor build #6326
Being able to navigate to a PR page of an AppVeyor build #6326
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6326 +/- ##
==========================================
+ Coverage 46.28% 46.64% +0.35%
==========================================
Files 683 687 +4
Lines 51297 51641 +344
Branches 6729 6805 +76
==========================================
+ Hits 23741 24086 +345
+ Misses 26330 26248 -82
- Partials 1226 1307 +81
|
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.
Nice 👍
I'd like to see tests for the new functionality.
It would be good to have tests QueryBuildsResults
as well. To achieve that it is better to have it refactored by extracting everything below var result = await GetResponseAsync(...
line into a separate method.
GitUI/UserControls/RevisionGrid/RevisionGridControl.Designer.cs
Outdated
Show resolved
Hide resolved
@@ -189,6 +189,24 @@ private class Project | |||
public string QueryUrl; | |||
} | |||
|
|||
private string BuildPullRequetUrl(string repositoryType, string repositoryName, string pullRequestId) | |||
{ | |||
switch (repositoryType) |
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.
switch (repositoryType) | |
switch (repositoryType.ToLowerInvariant()) |
(though ToUpperInvariant
is faster)
return null; | ||
} | ||
|
||
return null; |
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 redundant
90ae937
to
5cf47f0
Compare
done. |
f18dd26
to
ffb0014
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.
Looks good, few minor tweaks
buildInfo.Should().HaveCount(0); | ||
} | ||
|
||
private const string ContentBegin = @"{ |
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.
Let's move large chunks of input data into physical files and assert the result with ApprovalTests.
Load:
Lines 33 to 39 in d0e8c63
public void Deserialize_should_load_legacy_categorised_repositories() | |
{ | |
var xml = EmbeddedResourceLoader.Load(Assembly.GetExecutingAssembly(), $"{GetType().Namespace}.MockData.CategorisedRepositories01.xml"); | |
if (string.IsNullOrWhiteSpace(xml)) | |
{ | |
throw new FileFormatException("Unexpected data"); | |
} |
Assert (few overloads available):
Line 105 in d0e8c63
Approvals.VerifyXml(xml); |
This will create a
testname.approved.txt
file that can be viewed in a normal diff viewer. The .approved. files gets committed into the repo.
This will significantly simplify the maintenance of tests and change of data, if necessary.
ffb0014
to
ae455c0
Compare
0f29c99
to
ccb4df0
Compare
done.
I choose to serialize in Yaml because it's easy to specify a customer serializer (maybe it's possible in json or xml without having to change the tested code....). Indeed, the xml serializer throw due to unable to serialize an interface and json serializer just ignored the data so the test would not have verified all the datas we wanted. I also have updated the |
ccb4df0
to
0ceee76
Compare
0ceee76
to
d0ae949
Compare
.gitattributes
Outdated
@@ -7,4 +7,4 @@ | |||
*.sh text eol=lf | |||
*.py text eol=lf | |||
*.bin binary | |||
*.approved.* binary | |||
*.approved.* -text |
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 think we can remove this line completely
https://github.com/approvals/ApprovalTests.Net#approved-file-artifacts
Some years ago it was necessary because EOL would change and fail 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.
LGTM, haven't tested
d0ae949
to
4e04408
Compare
done. |
4e04408
to
164b1d3
Compare
Thank you |
Proposed changes
AppVeyor build report contains the data to get the url of the Pull request page.
So add an menu item in the contextual revision grid menu to be able to open the page.
Obviously, this menu item is only displayed when a PR has been built.
Support of GitHub, bitbucket and gitlab for the moment.
PR icon is from https://octicons.github.com/ (MIT licence)
Screenshots
Test methodology
Test environment(s)