Skip to content

Commit 8573f8e

Browse files
Mewbiclaude
andcommitted
Update README with test instructions and setup guide
Add service description, environment setup step (copy test.env to .env), testing section for unit and integration tests, and act usage instructions. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 294f781 commit 8573f8e

1 file changed

Lines changed: 53 additions & 9 deletions

File tree

README.md

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# 👨‍💻 Simple Retro
22

3+
Backend service for the Simple Retro website. This API provides endpoints for managing retrospectives, including creating and managing retrospective sessions, questions, answers, and real-time updates via WebSocket.
4+
35
## 🔥 | Running the project
46

5-
To run Simple Retro API, you need to have [Golang](https://go.dev/) in your machine. We recommend at least version 1.21.
7+
To run Simple Retro API, you need to have [Golang](https://go.dev/) in your machine
68

79
1. 🧹 Clone the repository
810

@@ -16,7 +18,15 @@ git clone git@github.com:simple-retro/backend.git
1618
go get .
1719
```
1820

19-
3. 🏃‍♂️ Running
21+
3. 📝 Set up environment variables
22+
23+
Copy the test environment file to create your local `.env` file:
24+
25+
```bash
26+
cp config/test.env config/.env
27+
```
28+
29+
4. 🏃‍♂️ Running
2030

2131
```bash
2232
go run main.go
@@ -54,13 +64,47 @@ docker build -t backend:<version> .
5464
docker compose up -d
5565
```
5666

57-
## 🔨 | Made With
58-
59-
- [Go](https://go.dev/)
60-
- [Gin](https://github.com/gin-gonic/gin)
61-
- [Swag](https://github.com/swaggo/swag)
62-
- [SQLite3](https://github.com/mattn/go-sqlite3)
63-
- [Gorilla Websocket](https://github.com/gorilla/websocket)
67+
## 🧪 | Running Tests
68+
69+
### Unit Tests
70+
71+
Run unit tests with:
72+
73+
```bash
74+
go test -v $(go list ./... | grep -v /integration_test)
75+
```
76+
77+
### Integration Tests
78+
79+
Integration tests require the service to be running first.
80+
81+
1. Start the service:
82+
83+
```bash
84+
go run main.go
85+
```
86+
87+
2. In another terminal, run the integration tests:
88+
89+
```bash
90+
API_BASE_URL=http://127.0.0.1:8080 go test -v ./integration_test/...
91+
```
92+
93+
### Testing with Act
94+
95+
You can use [act](https://github.com/nektos/act) to test GitHub Actions locally.
96+
97+
For unit tests:
98+
99+
```bash
100+
act -j unit-tests
101+
```
102+
103+
For integration tests, you need to use the `--bind` flag:
104+
105+
```bash
106+
act -j integration-tests --bind
107+
```
64108

65109
## ⚖️ | License
66110

0 commit comments

Comments
 (0)