actionlint: TestLintFindProjectFromPath test fail on v1.6.25
Running go test -v ./ ./scripts/... on v1.6.25 fails with this error:
=== RUN TestLintFindProjectFromPath
linter_test.go:223: no error was detected though the project was found from path parameter
--- FAIL: TestLintFindProjectFromPath (0.00s)
Although it says no error was detected, but it fails, I haven’t investigated more. Full log: https://github.com/aminvakil/aur/actions/runs/5282061811/jobs/9556494234?pr=274#step:11:1968
Tests are running every night and it was fine during the previous upgrades, you can see more in github repository as well.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 23 (11 by maintainers)
Commits related to this issue
- actionlint: Fix running unit tests This fixes https://github.com/rhysd/actionlint/issues/307 — committed to rhysd/aur-for-actionlint-bug by rhysd a year ago
- actionlint: Fix running unit tests This fixes https://github.com/rhysd/actionlint/issues/307 — committed to archlinux/aur by rhysd a year ago
- create fake `.git` directory to test detecting repository root (#307) instead of using actionlint's `.git` directory — committed to rhysd/actionlint by rhysd a year ago
https://github.com/aminvakil/aur/pull/274 tests passed and merged.
You can see the result https://aur.archlinux.org/cgit/aur.git/log/?h=actionlint
I fixed the test case to work even if
actionlint/.gitdoesn’t exist. From v1.6.26 release, you can safely remove the change in https://github.com/aminvakil/aur/pull/281.There is no guarantee that
.githubdirectory is put in root repository only. For example,.githubdirectory may be put in somewhere else and symlinked to root of the repository. It’s better to check both.gitand.githubIMO.I’ll add fix in this repository as well. However, for releasing v1.6.25, the fix in your side would be necessary until the next version (probably v1.6.26) is released.
.gitis necessary becauseTestLintFindProjectFromPathchecks if actionlint can find repository root directory. actionlint finds repository root by looking at.gitdirectory. Currently actionlint repository’s.gitis used for the test. Git does not allow committing.gitdirectory (git add testdata/.gitis simply ignored) so it is tricky to prepare a fake.gitdirectory for tests.Please tell me if there was any problem in running CI, …
Today I could reproduce this issue in my forked repository. I’ll investigate what is happening.
https://github.com/rhysd/aur-for-actionlint-bug/actions/runs/5312477943/jobs/9617034652