[PR #10594] [MERGED] lint: enable usetesting, disable tenv #23828

Closed
opened 2026-04-19 17:14:36 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/10594
Author: @mxyng
Created: 5/6/2025
Status: Merged
Merged: 5/8/2025
Merged by: @mxyng

Base: mainHead: mxyng/usetesting


📝 Commits (1)

  • 66bbe45 lint: enable usetesting, disable tenv

📊 Changes

12 files changed (+55 additions, -87 deletions)

View changed files

📝 .golangci.yaml (+1 -1)
📝 api/client_test.go (+2 -3)
📝 benchmark/server_benchmark_test.go (+3 -3)
📝 cmd/cmd_test.go (+6 -12)
📝 llm/server_test.go (+1 -1)
📝 server/images_test.go (+16 -36)
📝 server/internal/internal/backoff/backoff_test.go (+1 -2)
📝 server/modelpath_test.go (+5 -8)
📝 server/prompt_test.go (+1 -2)
📝 server/routes_generate_test.go (+2 -2)
📝 server/routes_test.go (+1 -1)
📝 server/sched_test.go (+16 -16)

📄 Description

usetesting prevents mistakes when writing unit tests such as using os.MkdirTemp() instead of t.TempDir() which handles error cases as well as cleaning up the temp directory and all contents. it also covers t.Setenv() cases previously covered by tenv


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/10594 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 5/6/2025 **Status:** ✅ Merged **Merged:** 5/8/2025 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/usetesting` --- ### 📝 Commits (1) - [`66bbe45`](https://github.com/ollama/ollama/commit/66bbe45f576666111366f5994498316d6c2f50a1) lint: enable usetesting, disable tenv ### 📊 Changes **12 files changed** (+55 additions, -87 deletions) <details> <summary>View changed files</summary> 📝 `.golangci.yaml` (+1 -1) 📝 `api/client_test.go` (+2 -3) 📝 `benchmark/server_benchmark_test.go` (+3 -3) 📝 `cmd/cmd_test.go` (+6 -12) 📝 `llm/server_test.go` (+1 -1) 📝 `server/images_test.go` (+16 -36) 📝 `server/internal/internal/backoff/backoff_test.go` (+1 -2) 📝 `server/modelpath_test.go` (+5 -8) 📝 `server/prompt_test.go` (+1 -2) 📝 `server/routes_generate_test.go` (+2 -2) 📝 `server/routes_test.go` (+1 -1) 📝 `server/sched_test.go` (+16 -16) </details> ### 📄 Description `usetesting` prevents mistakes when writing unit tests such as using `os.MkdirTemp()` instead of `t.TempDir()` which handles error cases as well as cleaning up the temp directory and all contents. it also covers `t.Setenv()` cases previously covered by `tenv` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-19 17:14:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#23828