test: extract go bin

This commit is contained in:
Michael Barz
2025-03-12 11:32:21 +01:00
parent a000dd9612
commit 22fb783724
25 changed files with 43 additions and 71 deletions

View File

@@ -5,7 +5,6 @@ linters:
disable:
- contextcheck # FIXME: causes panic in graph service
- lll # 760 issues in the codebase
- exhaustivestruct
- exhaustruct
- exhaustive # 634 issues in the codebase
- wrapcheck # 398 issues in the codebase
@@ -16,14 +15,12 @@ linters:
- forbidigo
- gochecknoglobals
- nlreturn
- nosnakecase # each 100-200 issues in codebase
- gci
- godot
- funlen
- gomnd
- gofumpt
- ireturn
- goerr113
- err113
- containedctx
- paralleltest
- gocritic # each 50-100 issues in codebase
@@ -31,8 +28,6 @@ linters:
- cyclop
- noctx
- testpackage
- maligned
- golint
- forcetypeassert
- nonamedreturns
- dupl

View File

@@ -67,18 +67,6 @@ fmt:
@echo "- $(NAME): fmt"
gofmt -s -w $(SOURCES)
.PHONY: golangci-lint-fix
golangci-lint-fix: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run $(LINTERS) --fix
.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run --path-prefix services/$(NAME)
.PHONY: ci-golangci-lint
ci-golangci-lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run --path-prefix services/$(NAME) --timeout 15m0s --issues-exit-code 0 --out-format checkstyle > checkstyle.xml
.PHONY: test
test:
@go test -v -tags '$(TAGS)' -coverprofile coverage.out ./...

View File

@@ -418,8 +418,14 @@ def main(ctx):
build_release_helpers = \
changelog() + \
docs() + \
licenseCheck(ctx)
docs()
build_release_helpers.append(
pipelineDependsOn(
licenseCheck(ctx),
getGoBinForTesting(ctx),
),
)
test_pipelines = \
codestyle(ctx) + \
@@ -1741,20 +1747,9 @@ def binaryRelease(ctx, arch, build_type, target, depends_on = []):
}
def licenseCheck(ctx):
# uploads third-party-licenses to https://download.owncloud.com/ocis/ocis/daily/
target = "/ocis/%s/daily" % (ctx.repo.name.replace("ocis-", ""))
if ctx.build.event == "tag":
# uploads third-party-licenses to eg. https://download.owncloud.com/ocis/ocis/1.0.0-beta9/
folder = "stable"
buildref = ctx.build.ref.replace("refs/tags/v", "")
buildref = buildref.lower()
if buildref.find("-") != -1: # "x.x.x-alpha", "x.x.x-beta", "x.x.x-rc"
folder = "testing"
target = "/ocis/%s/%s/%s" % (ctx.repo.name.replace("ocis-", ""), folder, buildref)
return [{
return {
"name": "check-licenses",
"steps": [
"steps": restoreGoBinCache() + [
{
"name": "node-check-licenses",
"image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
@@ -1840,7 +1835,7 @@ def licenseCheck(ctx):
},
],
"workspace": workspace,
}]
}
def releaseDockerManifest(ctx, repo, build_type):
spec = "manifest.tmpl"
@@ -2503,10 +2498,8 @@ def genericCachePurge(flush_path):
{
"event": "pull_request",
},
# {
# "status": ["success", "failure"]
# },
],
"runs_on": ["failure"],
}
def genericBuildArtifactCache(ctx, name, action, path):

View File

@@ -213,20 +213,16 @@ protobuf:
done
.PHONY: golangci-lint
golangci-lint:
@for mod in $(OC_MODULES); do \
$(MAKE) --no-print-directory -C $$mod golangci-lint; \
done
golangci-lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run --modules-download-mode vendor --timeout 15m0s --issues-exit-code 0 --out-format checkstyle > checkstyle.xml
.PHONY: ci-golangci-lint
ci-golangci-lint: $(GOLANGCI_LINT)
ci-golangci-lint:
$(GOLANGCI_LINT) run --modules-download-mode vendor --timeout 15m0s --issues-exit-code 0 --out-format checkstyle > checkstyle.xml
.PHONY: golangci-lint-fix
golangci-lint-fix:
@for mod in $(OC_MODULES); do \
$(MAKE) --no-print-directory -C $$mod golangci-lint-fix; \
done
golangci-lint-fix: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run --fix --modules-download-mode vendor --timeout 15m0s --issues-exit-code 0 --out-format checkstyle > checkstyle.xml
.PHONY: test-gherkin-lint
test-gherkin-lint:
@@ -241,13 +237,13 @@ bingo-update: $(BINGO)
$(BINGO) get -l -v -t 20
.PHONY: check-licenses
check-licenses: ci-go-check-licenses ci-node-check-licenses
check-licenses: $(GO_LICENSES) ci-go-check-licenses ci-node-check-licenses
.PHONY: save-licenses
save-licenses: ci-go-save-licenses ci-node-save-licenses
save-licenses: $(GO_LICENSES) ci-go-save-licenses ci-node-save-licenses
.PHONY: ci-go-check-licenses
ci-go-check-licenses: $(GO_LICENSES)
ci-go-check-licenses:
$(GO_LICENSES) check ./...
.PHONY: ci-node-check-licenses
@@ -257,7 +253,7 @@ ci-node-check-licenses:
done
.PHONY: ci-go-save-licenses
ci-go-save-licenses: $(GO_LICENSES)
ci-go-save-licenses:
@mkdir -p ./third-party-licenses/go/opencloud/third-party-licenses
$(GO_LICENSES) csv ./... > ./third-party-licenses/go/opencloud/third-party-licenses.csv
$(GO_LICENSES) save ./... --force --save_path="./third-party-licenses/go/opencloud/third-party-licenses"

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -14,7 +14,7 @@ include ../../.make/release.mk
include ../../.make/docs.mk
.PHONY: go-generate
go-generate: $(MOCKERY)
go-generate:
$(MOCKERY)
.PHONY: l10n-pull

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks

View File

@@ -1,4 +1,4 @@
// Code generated by mockery v2.53.0. DO NOT EDIT.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks