Skip to content

Commit f0ad2d9

Browse files
committed
make test github compatible
1 parent 13ea6ef commit f0ad2d9

File tree

6 files changed

+24
-4
lines changed

6 files changed

+24
-4
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ jobs:
1313
with:
1414
go-version: '1.22'
1515
- name: Run coverage
16-
run: make test
16+
run: make test/github

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@ help:
1616
## test: run all tests
1717
.PHONY: test
1818
test:
19-
go test -v -race -buildvcs $(shell go list ./... | grep -v 'runtime/')
19+
go test -v -race -buildvcs $(shell go list ./... | grep -v 'runtime/')
2020

2121
fmt:
2222
@gofmt -l -w $(shell find . -type f -name '*.go' -not -path "./vendor/*")
2323

24+
lint:
25+
golangci-lint run
26+
27+
## Run all tests except TestContext
28+
test/github:
29+
go test -v -race -buildvcs $(shell go list ./... | grep -v 'runtime/') -run "${GITHUB_TEST_PATTERN}"
2430

2531
## test/cover: run all tests and display coverage
2632
.PHONY: test/cover

pkgs/client/context_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/gorilla/mux"
1010
)
1111

12+
// This only works locally with a valid oauth token
1213
func TestContext(t *testing.T) {
1314
// create a rest server
1415
router := mux.NewRouter()

pkgs/funcstore/funcstore.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ import "database/sql"
44

55
type Funcstore interface {
66
Get(db *sql.DB, cmd string, gid string) (string, error)
7-
Create(db *sql.DB, cmd string, hash string, gid string) error
7+
Create(db *sql.DB, cmd string, gid string) error
88
Exec(cmd string, gid string) error
99
Delete(db *sql.DB, cmd string, gid string) error
1010
}
11+
12+
func getCachedFuncPath() {
13+
14+
}

pkgs/server/sqlite.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func AddRole(db *sql.DB, guildid int64, roleid string) error {
268268
}
269269

270270
// Lookup guild from guildid
271-
func LookupGuild(db *sql.DB, guildid int64) (*GuildMetaRow, error) {
271+
func LookupGuildbyId(db *sql.DB, guildid int64) (*GuildMetaRow, error) {
272272
// Check GuildMetaCache by guildid
273273
if val, ok := GuildMetaCache.Get(fmt.Sprintf("%d", guildid)); ok {
274274
return val.(*GuildMetaRow), nil

runtimes/golang/main.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
11
package main
2+
3+
func ExecLocal() {
4+
//TODO: Execute this locally
5+
}
6+
7+
// TODO:
8+
func main() {
9+
10+
}

0 commit comments

Comments
 (0)