[PR #2377] [CLOSED] Add Dockerfile for running tests in container #16373

Closed
opened 2025-11-02 12:09:08 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2377
Author: @Morlinest
Created: 8/24/2017
Status: Closed

Base: masterHead: feature/dockerfile-for-testing


📝 Commits (2)

  • b4f0ffb Add Dockerfile for running tests in container
  • 39263ef Add option to Dockerfile to use local repository with testing

📊 Changes

1 file changed (+55 additions, -0 deletions)

View changed files

Dockerfile.tests (+55 -0)

📄 Description

I've created Docker container to be able do tests on my local machine with Windows (but can be used on any platform) using Docker for Windows. I hope it can be helpful for someone else too.

Usage

Build image

$ docker build -f Dockerfile.tests -t gitea-tests .

Run image (only once, container is removed after finish)

$ docker run -ti --rm \
-e BRANCH=fix/missing-collaborative-repositories \
-e REPOSITORY=https://github.com/Morlinest/gitea.git \
gitea-tests

Run image (first time clone repo, then just pull changes)

# First run
$ docker run -ti --name gitea-test \
-e BRANCH=fix/missing-collaborative-repositories \
-e REPOSITORY=https://github.com/Morlinest/gitea.git \
gitea-tests
# Second and next runs
$ docker start -i gitea-test
# See all run tests
$ docker logs gitea-test

You can run multiple containers with different names (--name <my-super-branch-name>) for each branch and run tests independently.

Output example:

image


🔄 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/2377 **Author:** [@Morlinest](https://github.com/Morlinest) **Created:** 8/24/2017 **Status:** ❌ Closed **Base:** `master` ← **Head:** `feature/dockerfile-for-testing` --- ### 📝 Commits (2) - [`b4f0ffb`](https://github.com/go-gitea/gitea/commit/b4f0ffbc60e8553c40d721d63857085a3bb9fa54) Add Dockerfile for running tests in container - [`39263ef`](https://github.com/go-gitea/gitea/commit/39263efe27eecd2f9c3f469797f3d6ea81a3b494) Add option to Dockerfile to use local repository with testing ### 📊 Changes **1 file changed** (+55 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `Dockerfile.tests` (+55 -0) </details> ### 📄 Description I've created Docker container to be able do tests on my local machine with Windows (but can be used on any platform) using Docker for Windows. I hope it can be helpful for someone else too. ## Usage ### Build image ``` $ docker build -f Dockerfile.tests -t gitea-tests . ``` ### Run image (only once, container is removed after finish) ``` $ docker run -ti --rm \ -e BRANCH=fix/missing-collaborative-repositories \ -e REPOSITORY=https://github.com/Morlinest/gitea.git \ gitea-tests ``` ### Run image (first time clone repo, then just pull changes) ``` # First run $ docker run -ti --name gitea-test \ -e BRANCH=fix/missing-collaborative-repositories \ -e REPOSITORY=https://github.com/Morlinest/gitea.git \ gitea-tests ``` ``` # Second and next runs $ docker start -i gitea-test ``` ``` # See all run tests $ docker logs gitea-test ``` You can run multiple containers with different names (`--name <my-super-branch-name>`) for each branch and run tests independently. ## Output example: ![image](https://user-images.githubusercontent.com/12720041/29643649-b3afdcf6-8870-11e7-8b53-bcc21f137b7c.png) --- <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 12:09:08 -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#16373