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

Set KO_DATA_PATH when running tests #2458

Closed
mattmoor opened this issue Nov 10, 2018 · 10 comments · Fixed by #2691
Closed

Set KO_DATA_PATH when running tests #2458

mattmoor opened this issue Nov 10, 2018 · 10 comments · Fixed by #2691
Assignees
Labels
area/test-and-release It flags unit/e2e/conformance/perf test issues for product features kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Comments

@mattmoor
Copy link
Member

I see the following in our e2e test logs. I believe this is because our default logging package is used by our test code as well and the knative/pkg/changeset package is trying and failing to find $KO_DATA_PATH/HEAD:

I1110 06:24:54.159] 2018-11-10T06:20:18.474Z	warn	logging/config.go:41	Fetch GitHub commit ID from kodata failed: "KO_DATA_PATH" does not exist or is empty

I believe we could get commit information in our e2e log output if we set KO_DATA_PATH=$REPO_ROOT/.git before invoking the tests.

cc @adrcunha

@knative-prow-robot knative-prow-robot added area/test-and-release It flags unit/e2e/conformance/perf test issues for product features kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/good-first-issue labels Nov 10, 2018
@mattmoor
Copy link
Member Author

cc @yanweiguo

@adrcunha
Copy link
Contributor

adrcunha commented Nov 14, 2018

Setting KO_DATA_PATH as you suggested and running the tests locally (in a branch called kodata) results in a similar error:

2018-11-13T21:51:32.502-0800    warn    logging/config.go:41    Fetch GitHub commit ID from kodata failed: "ref: refs/heads/kodata" is not a valid GitHub commit ID

@yanweiguo
Copy link
Contributor

The test branch is a non-committed branch. The content of .git/HEAD is "ref: refs/heads/" instead of a commit ID. If the test is run in a committed branch, there should not be such warning.

@adrcunha
Copy link
Contributor

Is this error expected even when the change is in a PR (i.e., not yet merged to the master branch)? Like https://gubernator.knative.dev/build/knative-prow/pr-logs/pull/knative_serving/2526/pull-knative-serving-integration-tests/1064981887061069826/

@yanweiguo
Copy link
Contributor

Is this error expected even when the change is in a PR (i.e., not yet merged to the master branch)? Like https://gubernator.knative.dev/build/knative-prow/pr-logs/pull/knative_serving/2526/pull-knative-serving-integration-tests/1064981887061069826/

Yes

@adrcunha adrcunha self-assigned this Nov 20, 2018
@mattmoor mattmoor added this to the Ice Box milestone Nov 27, 2018
@rprakashg
Copy link

I'm seeing this in logs when my build fails too.

@yanweiguo
Copy link
Contributor

I'm seeing this in logs when my build fails too.

This log is a warning and it won't break build.

@adrcunha
Copy link
Contributor

adrcunha commented Dec 7, 2018

Still doesn't work... Or maybe I'm doing something wrong.

#2526 is merged, it added KO_DATA_PATH for the E2E tests.

My test PR (#2672) shows the same error:

1207 22:56:20.122] 2018-12-07T22:45:11.163Z	warn	logging/config.go:41	Fetch GitHub commit ID from kodata failed: "ref: refs/heads/test" is not a valid GitHub commit ID

As you can see in https://prow.knative.dev/log?job=pull-knative-serving-integration-tests&id=1071170919482789888 (search for the message above)

@yanweiguo
Copy link
Contributor

Still doesn't work... Or maybe I'm doing something wrong.

#2526 is merged, it added KO_DATA_PATH for the E2E tests.

My test PR (#2672) shows the same error:

1207 22:56:20.122] 2018-12-07T22:45:11.163Z	warn	logging/config.go:41	Fetch GitHub commit ID from kodata failed: "ref: refs/heads/test" is not a valid GitHub commit ID

As you can see in https://prow.knative.dev/log?job=pull-knative-serving-integration-tests&id=1071170919482789888 (search for the message above)

KO_DATA_PATH tells where to fetch the HEAD file. The context in the file can be "ref: refs/heads/<branch-name>" if the branch is not merged or a commit ID if the branch was merged. There will only be no warns if KO_DATA_PATH is set and the docker images are built from a merged branch.

@adrcunha
Copy link
Contributor

adrcunha commented Dec 8, 2018

Thanks for the clarification, Yanwei. This is WAI then and knative/test-infra#304 sets the generic approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test-and-release It flags unit/e2e/conformance/perf test issues for product features kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants