Skip to content

Commit 0bbf2df

Browse files
authored
Merge branch 'main' into template-textanalyzer-message
2 parents e85e9cd + 156965f commit 0bbf2df

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+134
-5260
lines changed

.github/workflows/build-test-deploy.yaml

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -104,32 +104,7 @@ jobs:
104104
name: preflight
105105
path: bin/
106106
- run: chmod +x bin/preflight
107-
- run: |
108-
./bin/preflight --interactive=false --format=json examples/preflight/e2e.yaml > result.json
109-
cat result.json
110-
111-
EXIT_STATUS=0
112-
if grep -q "was not collected" result.json; then
113-
echo "Some files were not collected"
114-
EXIT_STATUS=1
115-
fi
116-
117-
if (( `jq '.pass | length' result.json` < 1 )); then
118-
echo "No passing preflights found"
119-
EXIT_STATUS=1
120-
fi
121-
122-
if (( `jq '.warn | length' result.json` > 0 )); then
123-
echo "Warnings found"
124-
EXIT_STATUS=1
125-
fi
126-
127-
if (( `jq '.fail | length' result.json` > 0 )); then
128-
echo "Failed preflights found"
129-
EXIT_STATUS=1
130-
fi
131-
132-
exit $EXIT_STATUS
107+
- run: make e2e-test
133108

134109
compile-supportbundle:
135110
runs-on: ubuntu-latest

CONTRIBUTING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,19 @@ Thank you for your interest in Troubleshoot, we welcome your participation. Plea
99
## Pull Requests
1010

1111
If you are interested in contributing a change to the code or documentation please open a pull request with your set of changes. The pull request will be reviewed in a timely manner.
12+
13+
## Tests
14+
15+
To run the tests locally run the following:
16+
17+
```bash
18+
make test
19+
```
20+
21+
Additionally, e2e tests can be run with:
22+
23+
```bash
24+
make support-bundle preflight e2e-test
25+
```
26+
27+
A kubernetes cluster as well as `jq` are required to run e2e tests.

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@ all: test support-bundle preflight collect
4141
ffi: fmt vet
4242
go build ${BUILDFLAGS} ${LDFLAGS} -o bin/troubleshoot.so -buildmode=c-shared ffi/main.go
4343

44-
# Run tests
44+
.PHONY: test
4545
test: generate fmt vet
4646
go test ${BUILDFLAGS} ./pkg/... ./cmd/... -coverprofile cover.out
4747

48+
.PHONY: e2e-test
49+
e2e-test:
50+
./test/validate-preflight-e2e.sh
51+
4852
.PHONY: support-bundle
4953
support-bundle:
5054
go build ${BUILDFLAGS} ${LDFLAGS} -o bin/support-bundle github.com/replicatedhq/troubleshoot/cmd/troubleshoot
@@ -74,6 +78,7 @@ generate: controller-gen client-gen
7478
$(CONTROLLER_GEN) \
7579
object:headerFile=./hack/boilerplate.go.txt paths=./pkg/apis/...
7680
$(CLIENT_GEN) \
81+
--output-base=./../../../ \
7782
--output-package=github.com/replicatedhq/troubleshoot/pkg/client \
7883
--clientset-name troubleshootclientset \
7984
--input-base github.com/replicatedhq/troubleshoot/pkg/apis \

examples/support-bundle/sample-supportbundle.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spec:
88
selector:
99
- app=example
1010
- component=nginx
11-
namespace: repl{{ Namespace }}
11+
namespace: default
1212
limits:
1313
maxAge: 720h # 30*24
1414
maxLines: 10000

github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/clientset.go

Lines changed: 0 additions & 110 deletions
This file was deleted.

github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/doc.go

Lines changed: 0 additions & 19 deletions
This file was deleted.

github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/fake/clientset_generated.go

Lines changed: 0 additions & 91 deletions
This file was deleted.

github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/fake/doc.go

Lines changed: 0 additions & 19 deletions
This file was deleted.

github.com/replicatedhq/troubleshoot/pkg/client/troubleshootclientset/fake/register.go

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)