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

fix(ci): fix ci pipeline errors #184

Merged
merged 13 commits into from
Jan 4, 2024
Merged

fix(ci): fix ci pipeline errors #184

merged 13 commits into from
Jan 4, 2024

Conversation

linrongbin16
Copy link
Owner

@linrongbin16 linrongbin16 commented Jan 3, 2024

Regression Test

Platforms

  • windows
  • macOS
  • linux

Hosts

Functions

  • Use GitLink to copy git link.
  • Use GitLink! to open git link in browser.
  • Use GitLink blame to copy the /blame git link.
  • Use GitLink! blame to open the /blame git link in browser.
  • Copy git link in a symlink directory of git repo.
  • Copy git link in an un-pushed git branch, and receive an expected error.
  • Copy git link in a pushed git branch but edited file, and receive a warning says the git link could be wrong.

@github-actions github-actions bot added the fix label Jan 3, 2024
@linrongbin16
Copy link
Owner Author

linrongbin16 commented Jan 3, 2024

Fix unit test breaks from #183, relate: #181


hi @lopi-py ,

would you please tell me, how should I execute the git.run_cmd in a sync way?

The unit tests in CI are failed: https://github.com/linrongbin16/gitlinker.nvim/actions/runs/7395276412/job/20118132290

image

Do I need to invoke async.scheduler ?


I don't understand, why _run_cmd will returns nil in unit test (for example _get_remote), but returns the real results when we running the plugin.

  1. _run_cmd:
    return _run_cmd(args, cwd or uv.cwd())
  2. unit test invoke _get_remote:
    local r = git._get_remote()

I think I understand how it works, to fix the test, I will split those functions and invoke them in vusted.

Or we could use other async libraries:

I found they are also feature rich, single file (easy to embed), and popular.

@lopi-py
Copy link
Contributor

lopi-py commented Jan 3, 2024

Its failing because you are running an async function in a non async function. I'm not sure how to handle it. I tried waiting on a non async context but I get attemp to cross C-bounady error. You could wrap it like this

async.run(function()
  -- run the actual test.
end)

Copy link

codecov bot commented Jan 4, 2024

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (1d59471) 73.40% compared to head (fdc4165) 68.63%.
Report is 1 commits behind head on master.

Files Patch % Lines
lua/gitlinker/git.lua 80.00% 4 Missing ⚠️
lua/gitlinker.lua 50.00% 2 Missing ⚠️
lua/gitlinker/linker.lua 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #184      +/-   ##
==========================================
- Coverage   73.40%   68.63%   -4.77%     
==========================================
  Files           7        7              
  Lines         786      794       +8     
==========================================
- Hits          577      545      -32     
- Misses        209      249      +40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@linrongbin16
Copy link
Owner Author

Its failing because you are running an async function in a non async function. I'm not sure how to handle it. I tried waiting on a non async context but I get attemp to cross C-bounady error. You could wrap it like this

async.run(function()
  -- run the actual test.
end)

Thank you! it works!

@linrongbin16 linrongbin16 merged commit 13bd6b1 into master Jan 4, 2024
9 checks passed
@linrongbin16 linrongbin16 deleted the fix-ci branch January 4, 2024 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants