Skip to content

Commit

Permalink
patch: Upgrade to Go 1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
alwitt committed May 8, 2024
1 parent ddfa60e commit f9b7fb0
Show file tree
Hide file tree
Showing 15 changed files with 183 additions and 172 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.22"

- name: Prepare UT mocks
run: |
go install github.com/vektra/mockery/v2@v2.38.0
go install github.com/vektra/mockery/v2@v2.43.0
mockery --dir db --name PersistenceManager
mockery --dir db --name ConnectionManager
mockery --dir utils --name SegmentReader
Expand Down Expand Up @@ -56,11 +56,11 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.22"

- name: Prepare UT mocks
run: |
go install github.com/vektra/mockery/v2@v2.38.0
go install github.com/vektra/mockery/v2@v2.43.0
mockery --dir db --name PersistenceManager
mockery --dir db --name ConnectionManager
mockery --dir utils --name SegmentReader
Expand All @@ -82,7 +82,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51.2
version: v1.57.2
args: --timeout 3m0s

test:
Expand Down Expand Up @@ -117,11 +117,11 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
go-version: "1.22"

- name: Prepare UT mocks
run: |
go install github.com/vektra/mockery/v2@v2.38.0
go install github.com/vektra/mockery/v2@v2.43.0
mockery --dir db --name PersistenceManager
mockery --dir db --name ConnectionManager
mockery --dir utils --name SegmentReader
Expand Down
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: golang:1.20.1
image: golang:1.22.1

stages:
- test
Expand Down Expand Up @@ -53,7 +53,7 @@ cicd:
UNITTEST_S3_ENDPOINT: minio:9000

script:
- go install github.com/vektra/mockery/v2@v2.38.0
- go install github.com/vektra/mockery/v2@v2.43.0
- mockery --dir db --name PersistenceManager
- mockery --dir db --name ConnectionManager
- mockery --dir utils --name SegmentReader
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ ts-sdk: .prepare ## Generate Javascript client

.PHONY: up
up: ## Prepare the docker stack
@docker-compose -f docker/docker-compose.yaml --project-directory $(BASE_DIR) up -d livemix-ctrl-node
@docker compose -f docker/docker-compose.yaml --project-directory $(BASE_DIR) up -d livemix-ctrl-node

.PHONY: up-edge
up-edge: ## Prepare the test edge node in the docker stack
@docker-compose -f docker/docker-compose.yaml --project-directory $(BASE_DIR) up -d livemix-edge-node
@docker compose -f docker/docker-compose.yaml --project-directory $(BASE_DIR) up -d livemix-edge-node

.PHONY: up-dev
up-dev: ## Prepare the development docker stack
@docker-compose -f docker/docker-compose.yaml --project-directory $(BASE_DIR) up -d livemix-ctrl-db livemix-memcached livemix-minio
@docker compose -f docker/docker-compose.yaml --project-directory $(BASE_DIR) up -d livemix-ctrl-db livemix-memcached livemix-minio

.PHONY: down
down: ## Take down docker stack
@docker-compose -f docker/docker-compose.yaml --project-directory $(BASE_DIR) down
@docker compose -f docker/docker-compose.yaml --project-directory $(BASE_DIR) down

.PHONY: ctrl
ctrl: build ## Run local development system control node application
Expand Down
36 changes: 18 additions & 18 deletions control/control_to_edge_rr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestControlToEdgeGetVideoSourceInfoResponse(t *testing.T) {
var requestInject goutils.ReqRespMessageHandler
mockRRClient.On(
"SetInboundRequestHandler",
mock.AnythingOfType("*context.emptyCtx"),
mock.AnythingOfType("context.backgroundCtx"),
mock.AnythingOfType("goutils.ReqRespMessageHandler"),
).Run(func(args mock.Arguments) {
requestInject = args.Get(1).(goutils.ReqRespMessageHandler)
Expand Down Expand Up @@ -82,12 +82,12 @@ func TestControlToEdgeGetVideoSourceInfoResponse(t *testing.T) {

mockSystem.On(
"GetVideoSourceByName",
mock.AnythingOfType("*context.emptyCtx"),
mock.AnythingOfType("context.backgroundCtx"),
"video-00",
).Return(videoInfo, nil).Once()
mockRRClient.On(
"Respond",
mock.AnythingOfType("*context.emptyCtx"),
mock.AnythingOfType("context.backgroundCtx"),
mock.AnythingOfType("goutils.ReqRespMessage"),
mock.AnythingOfType("[]uint8"),
mock.AnythingOfType("map[string]string"),
Expand Down Expand Up @@ -115,12 +115,12 @@ func TestControlToEdgeGetVideoSourceInfoResponse(t *testing.T) {

mockSystem.On(
"GetVideoSourceByName",
mock.AnythingOfType("*context.emptyCtx"),
mock.AnythingOfType("context.backgroundCtx"),
"video-00",
).Return(videoInfo, fmt.Errorf("dummy error")).Once()
mockRRClient.On(
"Respond",
mock.AnythingOfType("*context.emptyCtx"),
mock.AnythingOfType("context.backgroundCtx"),
mock.AnythingOfType("goutils.ReqRespMessage"),
mock.AnythingOfType("[]uint8"),
mock.AnythingOfType("map[string]string"),
Expand Down Expand Up @@ -159,7 +159,7 @@ func TestControlToEdgeListActiveRecordingOfSource(t *testing.T) {
var requestInject goutils.ReqRespMessageHandler
mockRRClient.On(
"SetInboundRequestHandler",
mock.AnythingOfType("*context.emptyCtx"),
mock.AnythingOfType("context.backgroundCtx"),
mock.AnythingOfType("goutils.ReqRespMessageHandler"),
).Run(func(args mock.Arguments) {
requestInject = args.Get(1).(goutils.ReqRespMessageHandler)
Expand Down Expand Up @@ -208,13 +208,13 @@ func TestControlToEdgeListActiveRecordingOfSource(t *testing.T) {

mockSystem.On(
"ListRecordingSessionsOfSource",
mock.AnythingOfType("*context.emptyCtx"),
mock.AnythingOfType("context.backgroundCtx"),
testSourceID,
true,
).Return(recordings, nil).Once()
mockRRClient.On(
"Respond",
mock.AnythingOfType("*context.emptyCtx"),
mock.AnythingOfType("context.backgroundCtx"),
mock.AnythingOfType("goutils.ReqRespMessage"),
mock.AnythingOfType("[]uint8"),
mock.AnythingOfType("map[string]string"),
Expand Down Expand Up @@ -246,13 +246,13 @@ func TestControlToEdgeListActiveRecordingOfSource(t *testing.T) {

mockSystem.On(
"ListRecordingSessionsOfSource",
mock.AnythingOfType("*context.emptyCtx"),
mock.AnythingOfType("context.backgroundCtx"),
testSourceID,
true,
).Return(recordings, fmt.Errorf("dummy error")).Once()
mockRRClient.On(
"Respond",
mock.AnythingOfType("*context.emptyCtx"),
mock.AnythingOfType("context.backgroundCtx"),
mock.AnythingOfType("goutils.ReqRespMessage"),
mock.AnythingOfType("[]uint8"),
mock.AnythingOfType("map[string]string"),
Expand Down Expand Up @@ -289,7 +289,7 @@ func TestControlToEdgeChangeVideoStreamingState(t *testing.T) {

mockRRClient.On(
"SetInboundRequestHandler",
mock.AnythingOfType("*context.emptyCtx"),
mock.AnythingOfType("context.backgroundCtx"),
mock.AnythingOfType("goutils.ReqRespMessageHandler"),
).Return(nil).Once()

Expand All @@ -313,7 +313,7 @@ func TestControlToEdgeChangeVideoStreamingState(t *testing.T) {
// Prepare mocks for request
mockRRClient.On(
"Request",
mock.AnythingOfType("*context.emptyCtx"),
mock.AnythingOfType("context.backgroundCtx"),
targetReqRespID,
mock.AnythingOfType("[]uint8"),
mock.AnythingOfType("map[string]string"),
Expand Down Expand Up @@ -356,7 +356,7 @@ func TestControlToEdgeStartRecording(t *testing.T) {

mockRRClient.On(
"SetInboundRequestHandler",
mock.AnythingOfType("*context.emptyCtx"),
mock.AnythingOfType("context.backgroundCtx"),
mock.AnythingOfType("goutils.ReqRespMessageHandler"),
).Return(nil).Once()

Expand All @@ -376,7 +376,7 @@ func TestControlToEdgeStartRecording(t *testing.T) {
// Prepare mocks for request
mockRRClient.On(
"Request",
mock.AnythingOfType("*context.emptyCtx"),
mock.AnythingOfType("context.backgroundCtx"),
testRRTargetID,
mock.AnythingOfType("[]uint8"),
mock.AnythingOfType("map[string]string"),
Expand Down Expand Up @@ -414,7 +414,7 @@ func TestControlToEdgeStartRecording(t *testing.T) {
// Prepare mocks for request
mockRRClient.On(
"Request",
mock.AnythingOfType("*context.emptyCtx"),
mock.AnythingOfType("context.backgroundCtx"),
testRRTargetID,
mock.AnythingOfType("[]uint8"),
mock.AnythingOfType("map[string]string"),
Expand Down Expand Up @@ -455,7 +455,7 @@ func TestControlToEdgeStopRecording(t *testing.T) {

mockRRClient.On(
"SetInboundRequestHandler",
mock.AnythingOfType("*context.emptyCtx"),
mock.AnythingOfType("context.backgroundCtx"),
mock.AnythingOfType("goutils.ReqRespMessageHandler"),
).Return(nil).Once()

Expand All @@ -476,7 +476,7 @@ func TestControlToEdgeStopRecording(t *testing.T) {
// Prepare mocks for request
mockRRClient.On(
"Request",
mock.AnythingOfType("*context.emptyCtx"),
mock.AnythingOfType("context.backgroundCtx"),
testRRTargetID,
mock.AnythingOfType("[]uint8"),
mock.AnythingOfType("map[string]string"),
Expand Down Expand Up @@ -514,7 +514,7 @@ func TestControlToEdgeStopRecording(t *testing.T) {
// Prepare mocks for request
mockRRClient.On(
"Request",
mock.AnythingOfType("*context.emptyCtx"),
mock.AnythingOfType("context.backgroundCtx"),
testRRTargetID,
mock.AnythingOfType("[]uint8"),
mock.AnythingOfType("map[string]string"),
Expand Down
Loading

0 comments on commit f9b7fb0

Please sign in to comment.