deno-cliffy icon indicating copy to clipboard operation
deno-cliffy copied to clipboard

fix: prompt/test/integration/number.ts - windows snapshot was out of date

Open sramam opened this issue 3 years ago • 10 comments

Fix windows snapshot so tests pass.

sramam avatar Jun 30 '21 18:06 sramam

Codecov Report

Merging #234 (7b23ef0) into main (a4943cb) will decrease coverage by 0.22%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #234      +/-   ##
==========================================
- Coverage   73.38%   73.15%   -0.23%     
==========================================
  Files          81       81              
  Lines        6218     6218              
  Branches     1061     1057       -4     
==========================================
- Hits         4563     4549      -14     
- Misses       1634     1645      +11     
- Partials       21       24       +3     
Impacted Files Coverage Δ
prompt/confirm.ts 76.92% <0.00%> (-3.85%) :arrow_down:
prompt/secret.ts 75.86% <0.00%> (-3.45%) :arrow_down:
prompt/_generic_prompt.ts 76.32% <0.00%> (-3.39%) :arrow_down:
prompt/checkbox.ts 80.83% <0.00%> (-3.34%) :arrow_down:
command/_utils.ts 65.09% <0.00%> (-2.84%) :arrow_down:
prompt/figures.ts 94.44% <0.00%> (-2.78%) :arrow_down:
ansi/ansi_escapes.ts 94.54% <0.00%> (-1.82%) :arrow_down:
flags/flags.ts 48.25% <0.00%> (-1.75%) :arrow_down:
prompt/select.ts 87.30% <0.00%> (-1.59%) :arrow_down:
flags/_utils.ts 92.75% <0.00%> (-1.45%) :arrow_down:
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a4943cb...7b23ef0. Read the comment docs.

codecov[bot] avatar Jun 30 '21 21:06 codecov[bot]

@sramam thx for the PR! Did you tested this locally on a windows machine? I aggree that the output should be 18 and not 19, but somehow the test outputs 19 on the github windows runner. If it work on your machine, than i think this is an issue with the integration test. Currently, i cannot test this on a windows machine because i'm not at home, but i can take a look tomorrow.

c4spar avatar Jun 30 '21 21:06 c4spar

I did test on my machine.

Strange that the CI tests fail now! https://github.com/c4spar/deno-cliffy/pull/234/checks?check_run_id=2956699063

What does the --location do in the CI tests?

I did try that too on my machine and it passes. (with the 18 that is)

sramam avatar Jun 30 '21 22:06 sramam

hm, I think there is something wrong with the integration test. 18 looks wrong to me too, but it works on my mac with 18 too. I think this needs further investigation and I feel like there should be a lot more output. I think every time u or d is pressed a new line should be rendered but it looks like only on enter a new line is rendered but then the output should be 21, 17 and 20 but that is not the case.

c4spar avatar Jun 30 '21 22:06 c4spar

The --location flag is only required for the local storage.

c4spar avatar Jun 30 '21 22:06 c4spar

Could it be a function of running in headless mode?

sramam avatar Jun 30 '21 22:06 sramam

Wdym with a function of running in headless mode?

c4spar avatar Jun 30 '21 22:06 c4spar

on the CI instance, there is no display. Perhaps the test behaves differently then? I do not know much about this, especially for windows, but have encountered some of these issues with ava in the past.

This is what a quick google search yielded and it's use in tests

sramam avatar Jun 30 '21 22:06 sramam

Ah ok now I got what you mean. Yeah maybe, but I feel like there should be no difference in headless mode because I just read the output of stdout. But maybe there is really something different in headless mode. Will need to take a deeper look tomorrow my time.

c4spar avatar Jun 30 '21 23:06 c4spar

Will need to take a deeper look tomorrow my time.

Absolutely. Thanks for the wonderful library and being so responsive.

sramam avatar Jun 30 '21 23:06 sramam

I will close this PR because i can not reproduce this on my windows machine and ci is working as well. if this issue still persists feel free to reopen.

c4spar avatar Mar 25 '23 11:03 c4spar