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

Customise AppVeyor Test 'passed', 'failed', 'skipped' status #1321

Closed
wants to merge 11 commits into from

Conversation

NZSmartie
Copy link
Contributor

This is to allow users to display text in their own language, or (in my case) unicode characters. For example:

http://img.shields.io/appveyor/tests/NZSmartie/coap-net-iu0to.svg?passed=%E2%9C%94&failed=%E2%9D%8C&skipped=%E2%9D%97

would show the following badge
image

@paulmelnikow paulmelnikow added the service-badge New or updated service badge label Dec 4, 2017
@tooomm
Copy link
Contributor

tooomm commented Dec 4, 2017

Interesting idea, I would like to see a documentation for that in the parameters section!

@NZSmartie
Copy link
Contributor Author

One of the problems is that it's difficult to document what a badge has. There has been progress for improving registering services API (#963) which could allow for standarised documentation for badges.

The query parameters introduced in this PR are specific to the AppVeyor test status badge. Thus, adding information to the parameters section at the bottom would be very misleading since it does not apply to other badges.

@tooomm
Copy link
Contributor

tooomm commented Dec 4, 2017

Ohh, I thought you could customize any badge in the sense that it would replace given words with the selected characters!

But undocumented or poorly documented features are always bad.
There could be a hint to this pr (or a wiki article) next to the appveyor badge at least for example.
The best solution might be to have an explanation right within the appveyor badge pop-up, like the text that all GitHub badges have. Check this screenshot: #1311 (comment)
The Documenation section is only there for "GitHub badges", you could use that to explain the appveyor specific custom options.

A general availability of something like this would be cool, sure.

@NZSmartie
Copy link
Contributor Author

Heh, that's new from last time I did a PR. will add what I can. cheers @tooomm

@paulmelnikow
Copy link
Member

Another way to document it would be an additional badge example. This also needs a test.

Could you clarify why this is better than the standard text? Since a goal of the project is to provide consistent badges, we try to choose a good default and avoid providing customization options. Do you think we should change the standard text? Translation is one thing (all the badges are in English; only some of that can be overridden) but what you're wanting here is more like an alternate format.

@platan
Copy link
Member

platan commented Dec 4, 2017

Code and documentation looks good for me. Additionally you could add some test for overriding values (default values are already tested in service tests).
But badges (examples from documentation) does not look good at my PC (Ubuntu 16.04)
Chrome:
chrome-screenshot-jsbin com-2017-12-04-19-57-15-495
Firefox:
firefox-screenshot-2017-12-4 js bin

edit:
It looks similar at Linux Mint 18.1

And Windows 10, Chrome 62
js bin collaborative javascript debugging

@NZSmartie
Copy link
Contributor Author

Regarding the mangled badges in development builds: Grab a copy of Verdana.ttf and place it in the repository root directory. then it'll look right

@platan
Copy link
Member

platan commented Dec 4, 2017

@NZSmartie with the font it works great! Thanks!
fixed-screenshot-jsbin com-2017-12-04-22-07-53-029

@NZSmartie
Copy link
Contributor Author

@paulmelnikow This PR is an alternative way of displaying the AppVeyor test badge. Because other components of the badge can already be customised (label, style, link, logo, logoWidth, link, colorA and colorB), adding badge specific customisation seemed like a not too far stretch.

The main motivation is that badges can get very wide when all 3 metric labels (passed, failed and skipped) are displayed. Allowing use of single unicode helps free up screen space

@paulmelnikow
Copy link
Member

paulmelnikow commented Dec 4, 2017

The main motivation is that badges can get very wide when all 3 metric labels (passed, failed and skipped) are displayed. Allowing use of single unicode helps free up screen space

That makes sense to me.

Another way we could go about this is to add a flag like ?valueStyle=compact that uses compact values without needing to specify unicode characters. That helps our goal of uniformity, while also being helpful for another use case.

What do you think about this tweak to the format?

https://img.shields.io/badge/tests-%E2%9C%94%2012%20%20%E2%9D%8C%203%20%20%E2%9D%97%203-orange.svg

I'm not sure if the ! is a clear way to convey skipped – it seems more like errored. I wonder if there is another symbol that might be more understandable.

The x and ! characters don't look great on my machine because they display in red:

screen shot 2017-12-04 at 6 42 39 pm

@paulmelnikow
Copy link
Member

// Test AppVeyor tests status badge with emoji
t.create('tests status with emoji labels')
.get('/tests/NZSmartie/coap-net-iu0to.json?passed=%E2%9C%94&failed=%E2%9D%8C&skipped=%E2%9D%97')
.expectJSONTypes(Joi.object().keys({ name: 'tests', value: isEmojiAppveyorTestTotals }));
Copy link
Member

Choose a reason for hiding this comment

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

Tests look great!

@NZSmartie
Copy link
Contributor Author

@NZSmartie
Copy link
Contributor Author

I like the idea of a &valueStyle=compact query parameter. lemme implement that

@paulmelnikow
Copy link
Member

paulmelnikow commented Dec 5, 2017

Does the information symbol convey skipped, though?

Here are some other ideas:

I'm rather partial to 6, which is the symbol for "escape."

The "skip track" icon, 3, is clear in meaning, but doesn't look good.

screen shot 2017-12-04 at 9 06 32 pm

@NZSmartie
Copy link
Contributor Author

Hmm, what about tilde?
example

@RedSparr0w
Copy link
Member

RedSparr0w commented Dec 5, 2017

I quite like the tilde sign, as its pretty simple and gets the point across.
Or the escape key, but it looks a little too small.

@paulmelnikow
Copy link
Member

The tilde is simple looking, though how does it convey "skipped"?

@NZSmartie
Copy link
Contributor Author

NZSmartie commented Dec 5, 2017

So, skipped tests may also indicate inconclusive tests (not enough input to assert on). With that in mind. I think a '?' could be used to say that a test isn't failed or passed.
example
Even when there's no failed tests, its easy to tell there were skipped tests
example
And for comparason; Fully passing tests
example

@NZSmartie
Copy link
Contributor Author

If someone want's to use another symbol for skipped tests, they can use the &skipped= query parameter 😛

@platan
Copy link
Member

platan commented Dec 5, 2017

In my opinion ? and ~ looks good, however ? looks a bit like 'unknown' for me.

@tooomm
Copy link
Contributor

tooomm commented Dec 6, 2017

I really like horizontal lines as divider:

Too bad macOS messes around with the fast-forward icon. I'm not convinced by the dot.
Also, macOS iOS changes the checkmark to a bigger black one which is bad as well.
Is there some other checkmark that works for apple and stays white?

On Windows+Firefox it looks clean and uniform:
screen

By the way... would the badge turn red if it contains only fails, or fails+skipped?

@NZSmartie
Copy link
Contributor Author

@tooomm
By the way... would the badge turn red if it contains only fails, or fails+skipped?

yup, that's exactly what it does

@NZSmartie
Copy link
Contributor Author

NZSmartie commented Dec 6, 2017

the reason why the symbols are inconsistent on each platform as the browser will fallback onto another font on the host OS that supports that unicode range. A solution would be to include a second true type font that includes a standardised set of fonts. like Font Awesome for example

@NZSmartie
Copy link
Contributor Author

How difficult would it be to embed a symbol (much like the brand logos) and use that for the ✔ ✘ and [skip symbol]?

@RedSparr0w
Copy link
Member

For the sake of consistency i think the only way will be to embed an svg image for the check, cross, and other symbol

@paulmelnikow
Copy link
Member

paulmelnikow commented Dec 7, 2017

Also, macOS changes the checkmark to a black one which is bad as well.

Where are you seeing that? I'm not seeing it in Chrome or Firefox.

example

I'm fine with that. ^^

It feels slightly cramped but we could tweak the spacing later on.

Another suggestion, riffing on the dot: midline horizontal ellipsis.

example

Black flag:

example

Circle with backslash:

example

Warning sign:

example

Rightward arrow to bar:

example

Double question mark:

example

@NZSmartie
Copy link
Contributor Author

@paulmelnikow have changed it to the full circle with horizontal bars. but the CI is failing due ot an error outside of my control. unless i need to merge with master?

@paulmelnikow
Copy link
Member

Yea, merging master into this branch should fix it.

@RedSparr0w
Copy link
Member

The checkmarks are black on iOS:
image
Also the extra squares aren't showing on this badge, but they are on the earlier example post you made:
image

@NZSmartie
Copy link
Contributor Author

@RedSparr0w I think for now this will do and I'll see what I can do in regards to #127 / #552 to make it cleaner

@tooomm
Copy link
Contributor

tooomm commented Dec 7, 2017

And/Or this:

For the sake of consistency i think the only way will be to embed an svg image for the check, cross, and other symbol

By the way: Font Awesome includes icons for github, twitter, telegram, bitbucket, facebook, gitlab, gratipay, slack etc. too! They also have icons in solid and outlined style.

@paulmelnikow
Copy link
Member

After sleeping on it, I like rightward arrow to bar. Most of our suggestions have conveyed "maybe" or "indeterminate," but this one actually suggests skipping.

example

These are different checks and X's. Arguably the badge more legible as the symbols are lighter so the numbers stand out more. How do they look on iOS?

example

@RedSparr0w
Copy link
Member

RedSparr0w commented Dec 7, 2017

The second thinner check mark looks good on iOS,

iOS 9 (safari):

Windows 10 (chrome):
image

My votes for either the arrow or the dot
example
example

@tooomm
Copy link
Contributor

tooomm commented Dec 8, 2017

Is there some other thicker arrow available? This one is really hard to see at all!
Also, it doesn't need to point against a wall in my opinion because that symbolizes end or to the end more than skip.

The dot is kinda bold next to the others, that's why I searched http://graphemica.com/search?q=arrow...
(had to use the bolder x, couldn't find the other)









Also found a bit smaller dot:

@paulmelnikow
Copy link
Member

Hi! Whoever picks this up, this work will need to be reworked a bit. A bunch of files moved in #1563, and an entirely rewritten copy of the appveyor service was merged in #1543.

@NZSmartie
Copy link
Contributor Author

This issue became stalled as there was disagreement on what icons/symbols to use for representing the various results. If a consensus is made, i'll be happy to pick it up again

@kzu
Copy link
Contributor

kzu commented Jul 29, 2018

Plz, merge some form of this. Given users can customize the icons, the defaults aren't critical to agree on.

I personally like this one mentioned above:

image

@PyvesB
Copy link
Member

PyvesB commented Aug 9, 2018

Okay, shall we try to push this forward again? We can always pick one solution, and change it later on if users dislike it. We could even create a poll in an separate issue to get feedback and some community interaction.

@NZSmartie I'm keen on you making an informed final call based on the discussions above. Quite a few things have changed with the Appveyor service, in particular in #1743, but I'm sure @paulmelnikow will be glad to assist you if you run into any trouble!

How does that sound? 😄

@kzu
Copy link
Contributor

kzu commented Aug 12, 2018

IMHO, since the icons can customize, it doesn't matter a whole lot which one you pick as a default. Any one is better than nothing at this point. And, if someone dislikes them, they can just customize it via the URL itself, so, no blocking issues ;)

@paulmelnikow
Copy link
Member

I can pick this up after #1940 is merged.

@paulmelnikow
Copy link
Member

Reopened at #2000.

paulmelnikow added a commit that referenced this pull request Sep 8, 2018
This picks up the work from #1321 on top of the work from #1940.

It allows the user to choose a compact tests format, or to override the labels with their own text or symbols.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge New or updated service badge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants