Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
NEOVIM_PATH: ${{ github.workspace }}/neovim
run: |
make patch-runner
# make patch-runner
cd neovim
TEST_FILE=test/functional/example_spec.lua make functionaltest

Expand Down
29 changes: 16 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
.PHONY: test patch-runner
.PHONY: validate test

# nvim -c "set runtimepath+=." -l test/gh_spec.lua
TEST_CWD := $(shell pwd)

validate:
ifeq ($(NEOVIM_PATH),)
$(error NEOVIM_PATH is not set. Export it or pass it like: make NEOVIM_PATH=/path/to/neovim test)
endif

# Run tests with "nvim -l" instead of "-ll", so tests can use the full "vim."
# API from the Nvim test harness process itself.
patch-runner:
@if grep -q -- "-ll " "$(NEOVIM_PATH)/cmake/RunTests.cmake"; then \
echo "Patching RunTests.cmake (-ll → -l)..."; \
sed -i.bak 's/-ll /-l /' "$(NEOVIM_PATH)/cmake/RunTests.cmake" && rm -f "$(NEOVIM_PATH)/cmake/RunTests.cmake.bak"; \
else \
echo "RunTests.cmake already patched; skipping."; \
fi
# patch-runner: validate
# @if grep -q -- "-ll " "$(NEOVIM_PATH)/cmake/RunTests.cmake"; then \
# echo "Patching RunTests.cmake (-ll → -l)..."; \
# sed -i.bak 's/-ll /-l /' "$(NEOVIM_PATH)/cmake/RunTests.cmake" && rm -f "$(NEOVIM_PATH)/cmake/RunTests.cmake.bak"; \
# else \
# echo "RunTests.cmake already patched; skipping."; \
# fi


test: patch-runner
ifeq ($(NEOVIM_PATH),)
$(error NEOVIM_PATH is not set)
endif
test: validate
ln -sf $(shell pwd) $(NEOVIM_PATH)/test/functional/guh.nvim
@cd $(NEOVIM_PATH) && env GH_TOKEN=$${GH_TOKEN:-$(shell gh auth token 2>/dev/null)} \
TEST_CWD=$(TEST_CWD) \
TEST_FILE=test/functional/guh.nvim/test/gh_spec.lua make functionaltest
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ Requirements:
without doing a checkout.
5. (TODO) PR comments will display on relevant git objects.

## Development

Run the tests:

NEOVIM_PATH='/path/to/neovim/' make test

Run specific tests:

NEOVIM_PATH='/path/to/neovim/' make test TEST_FILTER=load_comments

## Related

- https://github.com/pwntester/octo.nvim
Expand Down
Loading