Skip to content

Make sure test file names map source files names - #7338

Merged
6543 merged 27 commits into
woodpecker-ci:mainfrom
qwerty287:testfiles
Oct 31, 2026
Merged

6543 merged 27 commits into
woodpecker-ci:mainfrom
qwerty287:testfiles

Conversation

@qwerty287

Copy link
Copy Markdown
Contributor

also add a test step checking this.

This fails right because of the files

pipeline/runtime/helpers_test.go
server/api/helpers_sqlite_test.go
server/queue/fifo_bench_test.go

First are test utils (so not tests themself), last one are benchmarks. How should those be called?

@qwerty287
qwerty287 requested a review from a team October 18, 2026 11:20
@qwerty287 qwerty287 added tests related to tests or other things CI check before merge build CI pipeline related labels Oct 18, 2026
@6543

6543 commented Oct 18, 2026

Copy link
Copy Markdown
Member

benchmarks. How should those be called?

<file>_bench_test.go ?

i think unit tests amd integration tests are _test.go while benchmarks should be seperated files ...

... benchmarks are also usually only exec by maintainers if related stuff is changed. they are no good fit for regular ci runs, if we wana add it to ci we must have a way to garantee some stable enfironment where runtimes stay the same and compare to the past ...

... still to track tjat data and preserfe history would be good to catch regressions, trends etc ...

@qwerty287

Copy link
Copy Markdown
Contributor Author

I allowed _bench_test.go, and what about the helper files?

server/api/helpers_sqlite_test.go
server/queue/fifo_bench_test.go

@6543

6543 commented Oct 18, 2026

Copy link
Copy Markdown
Member

and what about the helper files?

😆 no idea

@qwerty287

Copy link
Copy Markdown
Contributor Author

Anyone else has an idea @woodpecker-ci/maintainers ?

The files

server/api/helpers_sqlite_test.go
server/queue/fifo_bench_test.go

contain helper functions only used in tests.

Comment thread pipeline/backend/local/local_test.go Resolved
Comment thread pipeline/runtime/step_test.go Resolved
@xoxys

xoxys commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Anyone else has an idea @woodpecker-ci/maintainers ?

The files

server/api/helpers_sqlite_test.go
server/queue/fifo_bench_test.go

contain helper functions only used in tests.

We could establish a convention (similar to *_<os>_test.go) e.g. *_utils_test.go and exclude it from the check script.

@6543

6543 commented Oct 23, 2026

Copy link
Copy Markdown
Member

also how to we do with #7322 (comment) (blackbox tests) mainly needed if you alter stuff ...

@qwerty287

Copy link
Copy Markdown
Contributor Author

I allowed utils_test.go (also without matching file) and also linux_test.go as suffix.

One note: If we now have a source file whatever_utils.go, the corresponding test file whatever_utils_test.go will be excluded from the check. I don't think that's avoidable though.

About blackbox tests: I don't really see a reason to not run it as part of the suite… Even if it takes some time. I would like to avoid having hundreds of exceptions of the naming scheme. But it's not a big think for me to exclude it from the scheme as well.

@woodpecker-bot

woodpecker-bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Surge PR preview deployment was removed

@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.62%. Comparing base (c075043) to head (795caf6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7338      +/-   ##
==========================================
- Coverage   64.63%   64.62%   -0.01%     
==========================================
  Files         448      448              
  Lines       22093    22093              
==========================================
- Hits        14279    14278       -1     
- Misses       7814     7815       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@qwerty287

Copy link
Copy Markdown
Contributor Author

@woodpecker-ci/maintainers is something missing here? It's a pain to always resolve the conflicts...

@6543

6543 commented Oct 31, 2026

Copy link
Copy Markdown
Member

no all good :)

@6543
6543 merged commit bfe5207 into woodpecker-ci:main Oct 31, 2026
6 of 7 checks passed
@woodpecker-bot woodpecker-bot mentioned this pull request Oct 31, 2026
1 task
@qwerty287
qwerty287 deleted the testfiles branch October 31, 2026 15:35
6543 pushed a commit to 6543-forks/woodpecker that referenced this pull request Nov 9, 2026
main renamed rpc_integration_test.go to rpc_test.go (woodpecker-ci#7338), so the
merge of main dropped the PR changes to it. Bring them back:
- drop StepFinished mocks from Update tests
- use service_log.StreamDelayAllowed
- add TestRPCLogFinalizeOverlap

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BXsZr17NA4Xtet1CJpW4aM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build CI pipeline related tests related to tests or other things CI check before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants