Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile and presubmit minor improvements #728

Merged
merged 3 commits into from
Feb 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,11 @@ test-e2e: bin/tkn ## run e2e tests
docs: bin/docs ## update docs
@echo "Update generated docs"
@./bin/docs --target=./docs/cmd

.PHONY: man
man: bin/docs ## update manpages
@echo "Update generated manpages"
@./bin/docs --target=./docs/man/man1 --kind=man
@rm -f ./bin/docs

.PHONY: generated
generated: test-unit-update-golden man docs fmt ## generate all files that needs to be generated
generated: test-unit-update-golden docs fmt ## generate all files that needs to be generated

.PHONY: clean
clean: ## clean build artifacts
Expand Down
8 changes: 4 additions & 4 deletions pkg/cmd/pipelinerun/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ func TestLog_run_failed_with_and_without_follow(t *testing.T) {
test.AssertOutput(t, failMessage+"\n", output)
}

func TestLog_pipeline_still_running(t *testing.T) {
func TestLog_pipelinerun_still_running(t *testing.T) {
var (
pipelineName = "inprogress-pipeline"
prName = "inprogress-run"
Expand Down Expand Up @@ -807,7 +807,7 @@ func TestLog_pipeline_still_running(t *testing.T) {
test.AssertOutput(t, "Pipeline still running ..."+"\n", output)
}

func TestLog_pipeline_status_done(t *testing.T) {
func TestLog_pipelinerun_status_done(t *testing.T) {
var (
pipelineName = "done-pipeline"
prName = "done-run"
Expand Down Expand Up @@ -908,7 +908,7 @@ func fetchLogs(lo *options.LogOptions) (string, error) {
return out.String(), err
}

func TestLog_pipeline_last(t *testing.T) {
func TestLog_pipelinerun_last(t *testing.T) {
var (
pipelineName = "pipeline1"
prName = "pr1"
Expand Down Expand Up @@ -976,7 +976,7 @@ func TestLog_pipeline_last(t *testing.T) {
test.AssertOutput(t, prName2, lopt.PipelineRunName)
}

func TestLog_pipeline_only_one(t *testing.T) {
func TestLog_pipelinerun_only_one(t *testing.T) {
var (
pipelineName = "pipeline1"
prName = "pr1"
Expand Down
20 changes: 19 additions & 1 deletion test/presubmit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function test_documentation_has_been_generated() {
header "Testing if documentation has been generated"

make docs
make man

if [[ -n $(git status --porcelain docs/) ]];then
echo "-- FATAL: The documentation or manpages didn't seem to be generated :"
Expand All @@ -44,6 +43,24 @@ function test_documentation_has_been_generated() {
results_banner "Documentation" 0
}


function test_golden_has_been_generated() {
header "Testing if golden files has been generated"

make test-unit-update-golden

if [[ -n $(git status --porcelain pkg/) ]];then
echo "-- FATAL: The golden files didn't seem to be generated, rerun 'make generated' :"
git status docs
git diff docs
results_banner "Golden" 1
exit 1
fi

results_banner "Golden" 0
}


function check_lint() {
header "Testing if golint/yamllint has been done"

Expand All @@ -62,6 +79,7 @@ function pre_build_tests() {
}

function post_build_tests() {
test_golden_has_been_generated
test_documentation_has_been_generated
check_lint
}
Expand Down