Skip to content

Commit

Permalink
feat(ci): run tests in addition to lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorres committed Apr 15, 2024
1 parent d98dd12 commit cbe5c23
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/run-lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Implicit requirements
# runner must have `docker` and `curl` installed (true on github-runners)

name: run-lint
name: tests

on:
push:
Expand Down Expand Up @@ -57,3 +57,23 @@ jobs:

- name: Check repository diff
run: bash ./.github/scripts/check-work-copy-equals-to-committed.sh "auto-format broken"
tests:
name: run tests
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install go
uses: actions/setup-go@v3
with:
go-version: "1.21"
- name: download dependencies
run: |
go mod download
echo "$HOME/go/bin" >> $GITHUB_PATH
- name: build ydbops
run: go build
- name: run tests
run: go test -v -p 1 ./... -args -ginkgo.v
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ linters-settings:
rangeValCopy:
# Size in bytes that makes the warning trigger.
# Default: 128
sizeThreshold: 32
sizeThreshold: 2048
# Whether to check test functions.
# Default: true
skipTestFuncs: false
Expand Down
4 changes: 2 additions & 2 deletions pkg/rolling/restarters/storage_k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (r StorageK8sRestarter) RestartNode(node *Ydb_Maintenance.Node) error {
func populateWithK8sRules(
nodes []*Ydb_Maintenance.Node,
spec FilterNodeParams,
FqdnToPodName map[string]string,
fqdnToPodName map[string]string,
) []*Ydb_Maintenance.Node {
if isInclusiveFilteringUnspecified(spec) {
return nodes
Expand All @@ -51,7 +51,7 @@ func populateWithK8sRules(
continue
}

if selectedHostFQDN == FqdnToPodName[node.Host] {
if selectedHostFQDN == fqdnToPodName[node.Host] {
selectedNodes = append(selectedNodes, node)
continue
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/rolling/rolling.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ func ExecuteRolling(
if err != nil {
logger.Errorf("Failed to complete restart: %+v", err)
return err
} else {
logger.Info("Restart completed successfully")
}

logger.Info("Restart completed successfully")
return nil
}

Expand Down

0 comments on commit cbe5c23

Please sign in to comment.