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

exclude third_party files from running unit tests #6012

Closed
Closed
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
1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ignore:
- "pkg/apis/pipeline/v1alpha1/zz_generated.deepcopy.go"
- "pkg/apis/pipeline/v1beta1/zz_generated.deepcopy.go"
- "third_party"
13 changes: 9 additions & 4 deletions docs/pipeline-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4569,6 +4569,9 @@ reasons that emerge from underlying resources are not included here</p>
</tr><tr><td><p>&#34;TaskRunImagePullFailed&#34;</p></td>
<td><p>TaskRunReasonImagePullFailed is the reason set when the step of a task fails due to image not being pulled</p>
</td>
</tr><tr><td><p>&#34;TaskRunResultLargerThanAllowedLimit&#34;</p></td>
<td><p>TaskRunReasonResultLargerThanAllowedLimit is the reason set when one of the results exceeds its maximum allowed limit of 1 KB</p>
</td>
</tr><tr><td><p>&#34;Running&#34;</p></td>
<td><p>TaskRunReasonRunning is the reason set when the TaskRun is running</p>
</td>
Expand Down Expand Up @@ -6347,15 +6350,17 @@ string
<td>
<code>kms</code><br/>
<em>
<a href="#tekton.dev/v1alpha1.HashAlgorithm">
HashAlgorithm
</a>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>KMS contains the KMS url of the public key
Supported formats differ based on the KMS system used.</p>
Supported formats differ based on the KMS system used.
One example of a KMS url could be:
gcpkms://projects/[PROJECT]/locations/[LOCATION]&gt;/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[KEY_VERSION]
For more examples please refer <a href="https://docs.sigstore.dev/cosign/kms_support">https://docs.sigstore.dev/cosign/kms_support</a>.
Note that the KMS is not supported yet.</p>
</td>
</tr>
<tr>
Expand Down
30 changes: 30 additions & 0 deletions test/presubmit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,36 @@ function post_build_tests() {
ko_resolve
}

function unit_tests() {
# Run tests in verbose mode to capture details.
# go doesn't like repeating -v, so remove if passed.
local args=" $@ "
local go_test="go test -race -v $(go list ./... | grep -v third_party/)"
# Just run regular go tests if not on Prow.
echo "Running tests with '${go_test}'"
local report=$(mktemp)
${go_test} | tee ${report}
local failed=( ${PIPESTATUS[@]} )
[[ ${failed[0]} -eq 0 ]] && failed=${failed[1]} || failed=${failed[0]}
echo "Finished run, return code is ${failed}"
# Install go-junit-report if necessary.
run_go_tool github.com/jstemmer/go-junit-report go-junit-report --help > /dev/null 2>&1
local xml="$(mktemp ${ARTIFACTS}/junit_XXXXXXXX).xml"
cat "${report}" \
| go-junit-report \
| sed -e "s#\"github.com/tektoncd/${REPO_NAME}/#\"#g" \
> ${xml}
echo "XML report written to ${xml}"
if (( ! IS_PROW )); then
# Keep the suffix, so files are related.
local logfile=${xml/junit_/go_test_}
logfile=${logfile/.xml/.log}
cp ${report} ${logfile}
echo "Test log written to ${logfile}"
fi
return ${failed}
}

# We use the default build, unit and integration test runners.

main $@
202 changes: 202 additions & 0 deletions third_party/cloud.google.com/go/iam/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading