Repository navigation
test(performance): compare resolved temp paths in resolve target tests - #1163
Open
RyoKusnadi wants to merge 1 commit into
Open
RyoKusnadi wants to merge 1 commit into
RyoKusnadi wants to merge 1 commit into
Conversation
Signed-off-by: Ryo Kusnadi <ryokusnadi@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two tests in
collector/pkg/performance/resolve_target_test.gofail on macOS because they compare an unresolved temp path with a resolved one. This fixes the expectations. Picked this up from my earlier comment in the issue.Type of Change
Test-only change, no production code touched.
Related Issues
Fixes #1048
Changes Made
go test ./collector/...fails two tests. How it happens:t.TempDir()is under/var/folders/..., a symlink to/private/var/folders/....resolveTargetPathreturns the resolved path, the test expects the raw one. Linux has no symlink there, so CI never sees it.TestResolveTargetPath_UsesConfiguredMountPointandTestResolveTargetPath_ConfiguredMountPointBeatsDirectIOOptInbuild the expected path from the rawt.TempDir().resolvedPathhelper (filepath.EvalSymlinks) used for the expected path. The configured mount point stays unresolved, so the tests still check that resolution happens.TempDiruses in the package either already resolve (ResolvesConfiguredSymlink), compare withtargetitself, or only check fallbacks.mount_linux_test.gois Linux-only.resolveTargetPathis unchanged.Testing
TestResolveTargetPath_UsesConfiguredMountPointand..._ConfiguredMountPointBeatsDirectIOOptIn: both failed before (/var/folders/...vs/private/var/folders/...) and pass now.Ran
go vet ./collector/pkg/performance/andgo test -count=1 ./collector/pkg/performance/, both pass.gofmt -lis clean.Not run: the rest of the repo, and golangci-lint (it stops on the repo's vendor/modules.txt being out of sync with go.mod).
Environment: develop @ 3c71a47, go1.27.4, darwin/arm64.
I have tested this locally
I have added/updated tests that prove my fix/feature works
All existing tests pass
Checklist