You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: fix tests locally on windows, additional dev setup directions (#129)
* chore: try running tests on windows runner too
* chore: turn off running tests on windows runners (fails, seems like it tries to run other containers as windows)
* fix: multi target upload true in sample config so tests pass out the gates
* fix: make logging test platform-agnostic
* chore: additional setup directions, improved local testing experience
Copy file name to clipboardExpand all lines: README.md
+27-10Lines changed: 27 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,11 +38,16 @@ The Satisfactory Mod Repository backend API - a Go-based service providing REST
38
38
mise run api
39
39
```
40
40
41
-
If running `api` produces errors about the database failing to apply migrations,
42
-
you may have switched branches without cleaning up after database changes you were working on.
43
-
The easiest way to get back from this state
44
-
is to delete the `postgres` Docker container
45
-
and delete all not-in-use volumes so it creates a fresh one.
41
+
If running `api` produces errors about the database failing to apply migrations,
42
+
you may have switched branches without cleaning up after database changes you were working on.
43
+
The easiest way to get back from this state
44
+
is to delete the `postgres` Docker container
45
+
and delete all not-in-use volumes so it creates a fresh one.
46
+
47
+
3. Set up the Configuration File
48
+
49
+
Create a copy of `config.sample.json` as `config.json` and fill in the required fields.
50
+
See the [Configuration](#configuration) section for details.
46
51
47
52
## Development Commands
48
53
@@ -54,7 +59,7 @@ mise run generate
54
59
mise run api
55
60
56
61
# Testing
57
-
mise run test
62
+
mise run localtest
58
63
mise run coverage
59
64
60
65
# Linting
@@ -68,6 +73,17 @@ mise run teardown # Stop services
68
73
mise activate pwsh | Out-String | Invoke-Expression
69
74
```
70
75
76
+
### Local Testing
77
+
78
+
To run specific tests:
79
+
80
+
- In VSCode, the [Go Companion](https://marketplace.visualstudio.com/items?itemName=ethan-reesor.exp-vscode-go) suggested extension adds Go test support to VSCode's testing integration.
81
+
Note you may need to reload VSCode (`Developer: Reload Window`) after adding or removing tests.
82
+
- From the command line, use `go test -v run TestNameHere`
83
+
84
+
To run all tests on your local machine, use `mise run localtest`, which excludes the verbose flag for easier human parsing of test output.
85
+
It is expected for the command to output `[no test files]` for packages with no tests.
86
+
71
87
### Database Access
72
88
73
89
The development docker compose also includes a pgadmin container for testing database related stuff
@@ -101,16 +117,17 @@ You can view tables via `Servers >(name)> Databases > postgres > Schemas > publi
101
117
102
118
## Configuration
103
119
104
-
Create `config.json` or use environment variables with `REPO_` prefix.
120
+
Create `config.json`, or use environment variables with `REPO_` prefix.
5.**PASETO keys** - Generate with `go run cmd/paseto/main.go`
113
-
6.**VirusTotal API key** - For mod scanning
128
+
4.**OAuth providers** - GitHub, Google, Facebook. For testing purposes, [setting up just GitHub](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) is the easiest.
129
+
5.**PASETO keys** - Generate these with `go run cmd/paseto/main.go`
130
+
6.**VirusTotal API key** - For mod scanning. Optional for testing.
114
131
115
132
**Development services** are started automatically with `mise run setup`. MinIO configuration is included in the setup task.
0 commit comments