[PR #555] [MERGED] Unit tests for models/pull.go #15451

Closed
opened 2025-11-02 11:46:49 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/555
Author: @ethantkoenig
Created: 1/2/2017
Status: Merged
Merged: 1/6/2017
Merged by: @andreynering

Base: masterHead: tests/pull


📝 Commits (1)

  • 72bfabf Unit tests for models/pull.go

📊 Changes

8 files changed (+421 additions, -21 deletions)

View changed files

models/fixtures/issue.yml (+46 -0)
models/fixtures/pull_request.yml (+28 -0)
models/fixtures/repository.yml (+21 -0)
models/fixtures/user.yml (+25 -0)
📝 models/issue.go (+22 -16)
📝 models/pull.go (+27 -5)
models/pull_test.go (+251 -0)
📝 models/repo.go (+1 -0)

📄 Description

The main problem is that I'm not sure the best way to "mock out" git repositories in the filesystem to match the database fixtures.

Should we add a script to create these repos? This seems less-than-ideal, since the script would be really tedious, and it would have to be kept in-sync with the test fixtures. Does anyone have a better suggestion?

I've removed all tests that depend on git, and replaced them with TODOs.


🔄 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/go-gitea/gitea/pull/555 **Author:** [@ethantkoenig](https://github.com/ethantkoenig) **Created:** 1/2/2017 **Status:** ✅ Merged **Merged:** 1/6/2017 **Merged by:** [@andreynering](https://github.com/andreynering) **Base:** `master` ← **Head:** `tests/pull` --- ### 📝 Commits (1) - [`72bfabf`](https://github.com/go-gitea/gitea/commit/72bfabfada8fc485b88eb4547b7d3575789a69c8) Unit tests for models/pull.go ### 📊 Changes **8 files changed** (+421 additions, -21 deletions) <details> <summary>View changed files</summary> ➕ `models/fixtures/issue.yml` (+46 -0) ➕ `models/fixtures/pull_request.yml` (+28 -0) ➕ `models/fixtures/repository.yml` (+21 -0) ➕ `models/fixtures/user.yml` (+25 -0) 📝 `models/issue.go` (+22 -16) 📝 `models/pull.go` (+27 -5) ➕ `models/pull_test.go` (+251 -0) 📝 `models/repo.go` (+1 -0) </details> ### 📄 Description ~~The main problem is that I'm not sure the best way to "mock out" git repositories in the filesystem to match the database fixtures.~~ ~~Should we add a script to create these repos? This seems less-than-ideal, since the script would be really tedious, and it would have to be kept in-sync with the test fixtures. Does anyone have a better suggestion?~~ I've removed all tests that depend on git, and replaced them with TODOs. --- <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 2025-11-02 11:46:49 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#15451