Skip to content

Commit

Permalink
Add some handler tests (#223)
Browse files Browse the repository at this point in the history
* Merge branch 'feature/handler_tests' into 'main'

Add repo handler tests

See merge request product/starhub/starhub-server!731

* fix repo handler test

* Merge branch 'feature/handler_tests' into 'main'

Add code handler tests and fix prompt component cycle import

See merge request product/starhub/starhub-server!741

* Merge branch 'feature/handler_tests' into 'main'

Add model/user/git-http handler tests

See merge request product/starhub/starhub-server!751

* Add opencsg check back to git http handler

* Merge branch 'feature/handler_tests' into 'main'

Add space/discussion/dataset/collection handler tests

See merge request product/starhub/starhub-server!759

* Merge branch 'feature/handler_tests' into 'main'

Add some handler tests

See merge request product/starhub/starhub-server!768

* Merge branch 'fix/swagger' into 'main'

Fix swagger doc, update makefile and ci

See merge request product/starhub/starhub-server!762

* add swag to makefile and update CI

* fix swag ci

* fix deployer resource check bug

* Merge branch 'fix-internal-api-error' into 'main'

Fix internal API error

See merge request product/starhub/starhub-server!772

* bump go mod version

---------

Co-authored-by: yiling.ji <[email protected]>
Co-authored-by: 泽华 <[email protected]>
  • Loading branch information
3 people authored Jan 2, 2025
1 parent 7d42103 commit 92314cd
Show file tree
Hide file tree
Showing 47 changed files with 7,942 additions and 2,425 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,35 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.23'
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
args: --timeout=5m
swagger:
name: swagger-gen
strategy:
matrix:
go: ["1.23"]
runs-on: ubuntu-latest
steps:
- name: Setup Go
with:
go-version: ${{ matrix.go }}
uses: actions/setup-go@v2

- uses: actions/checkout@v2

- name: Gen
run: |
go install github.com/swaggo/swag/cmd/swag@latest
make swag
test:
name: test
strategy:
matrix:
go: ["1.21.x"]
go: ["1.23"]
runs-on: ubuntu-latest
steps:
- name: Setup Go
Expand Down
18 changes: 16 additions & 2 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,23 @@ packages:
TagComponent:
AccountingComponent:
SpaceComponent:
SpaceResourceComponent:
RuntimeArchitectureComponent:
SensitiveComponent:
CodeComponent:
PromptComponent:
ModelComponent:
UserComponent:
GitHTTPComponent:
DiscussionComponent:
DatasetComponent:
CollectionComponent:
InternalComponent:
MirrorSourceComponent:
MirrorComponent:
EvaluationComponent:


opencsg.com/csghub-server/user/component:
config:
interfaces:
Expand Down Expand Up @@ -67,7 +77,7 @@ packages:
opencsg.com/csghub-server/mq:
config:
interfaces:
MessageQueue:
MessageQueue:
opencsg.com/csghub-server/builder/store/s3:
config:
interfaces:
Expand All @@ -92,7 +102,7 @@ packages:
config:
interfaces:
Builder:

opencsg.com/csghub-server/accounting/component:
config:
interfaces:
Expand All @@ -116,3 +126,7 @@ packages:
config:
interfaces:
Msg:
go.temporal.io/sdk/client:
config:
interfaces:
Client:
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.PHONY: test lint cover mock_wire mock_gen
.PHONY: test lint cover mock_wire mock_gen swag

test:
go test ./...

Expand All @@ -25,3 +25,6 @@ mock_wire:

mock_gen:
mockery

swag:
swag init --pd -d cmd/csghub-server/cmd/start,api/router,api/handler,builder/store/database,common/types,accounting/handler,user/handler,component -g server.go
Loading

0 comments on commit 92314cd

Please sign in to comment.