OmniSharp / omnisharp-vim

Vim omnicompletion (intellisense) and more for C#
http://www.omnisharp.net
MIT License
1.72k stars 168 forks source link

[fix] failing test #647

Closed get-me-power closed 4 years ago

get-me-power commented 4 years ago

I fixed travis's failing test. There was a problem in the initialization part of the variable, so I fixed it.

Before status

https://travis-ci.org/github/OmniSharp/omnisharp-vim/jobs/734638495

After status

https://travis-ci.org/github/OmniSharp/omnisharp-vim/jobs/734692738

Could you check this PR? @nickspoons

nickspoons commented 4 years ago

Thanks, but dict.key and dict['key'] are equivalent in vimscript.

I agree that the error message in the travis log looks like this is the error ("unknown variable 'start_time'”) but the actual error happened earlier, around line 246:

$ installer/omnisharp-manager.sh -l $HOME/.omnisharp/omnisharp-roslyn/
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     9  100     9    0     0     36      0 --:--:-- --:--:-- --:--:--    37
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

This means an attempt was made to download an omnisharp-roslyn release from GitHub, but it failed (happens frustratingly often). Just re-starting the CI usually works.

get-me-power commented 4 years ago

@nickspoons

Thanks for your review. I learned the real reason why CI is falling. So what about this patch?

Add "set -eu" to the behavior of the shell script between lines 142 and 149, and if there is a runtime error between these lines, return exit code 1 and drop CI. This prevents the vader from being executed unnecessarily.

nickspoons commented 4 years ago

Thanks. This also makes OmniSharp-vim output an error message when an install (:OmniSharpInstall) fails, whereas before it said "succeeded" when it hadn't.

get-me-power commented 4 years ago

@nickspoons Thanks for your merging!