Skip to content

fixing coverage#24529

Merged
alyssawilk merged 4 commits intoenvoyproxy:mainfrom
alyssawilk:coverage
Dec 14, 2022
Merged

fixing coverage#24529
alyssawilk merged 4 commits intoenvoyproxy:mainfrom
alyssawilk:coverage

Conversation

@alyssawilk
Copy link
Copy Markdown
Contributor

@alyssawilk alyssawilk commented Dec 14, 2022

Permissions on the coverage file lost +x. Forward fixing by explicitly running with sh.

Commit Message: n/a
Risk Level: n/a
Testing: manually
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@repokitteh-read-only
Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #24529 was opened by alyssawilk.

see: more, trace.

@phlax
Copy link
Copy Markdown
Member

phlax commented Dec 14, 2022

we could also revert the permissions on the file - so it can be run directly from its shebang

@alyssawilk
Copy link
Copy Markdown
Contributor Author

yeah I could do that as well but I wanted to make sure we didn't inadvertantly break it again.

@phlax
Copy link
Copy Markdown
Member

phlax commented Dec 14, 2022

in this case the shebang is bash so i think reverting the permissions is less likely to break anything

i just checked it makes no difference - it will still run bash with sh ...

actually it does matter - i just checked properly (by using bash only syntax) and it errors - at very least this needs to do bash ...

@phlax
Copy link
Copy Markdown
Member

phlax commented Dec 14, 2022

we probably also want to change:

if [ $? -eq 1 ]; then

to make it $? -ne 0

@alyssawilk
Copy link
Copy Markdown
Contributor Author

I did that, and it didn't make a difference locally. Which makes no sense to me because if I did echo $? it returned 126, but then skipped the -ne 0 block and said coverage passed.

@phlax
Copy link
Copy Markdown
Member

phlax commented Dec 14, 2022

if I did echo $? it returned 126

if im not wrong - its the old chestnut of echo succeeding 8/

@phlax
Copy link
Copy Markdown
Member

phlax commented Dec 14, 2022

does it fail if you do ...

RESPONSE=$?
echo $RESPONSE

if [ $RESPONSE -ne 0 ]; then ...

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk
Copy link
Copy Markdown
Contributor Author

I don't think I tested that. I think I did run without the echo. no strong feelings here though, I largely just wanted to avoid a second push on something that was working becasue I want to see if the coverage numbers need to be tweaked.

-
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
phlax
phlax previously approved these changes Dec 14, 2022
Copy link
Copy Markdown
Member

@phlax phlax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks @alyssawilk

@phlax
Copy link
Copy Markdown
Member

phlax commented Dec 14, 2022

v annoying shellcheck - not sure why the change is triggering this - fix can be:

diff --git a/test/run_envoy_bazel_coverage.sh b/test/run_envoy_bazel_coverage.sh
index 0fe90448b0..6ba361cb3b 100755
--- a/test/run_envoy_bazel_coverage.sh
+++ b/test/run_envoy_bazel_coverage.sh
@@ -119,8 +119,9 @@ set +e
 if [[ "$VALIDATE_COVERAGE" == "true" ]] && [[ "${FUZZ_COVERAGE}" == "false" ]]; then
   echo "Checking per-extension coverage"
   output=$(./test/per_file_coverage.sh)
+  response=$?
 
-  if [ $? -eq 1 ]; then
+  if [ $response -ne 0 ]; then
     echo Per-extension coverage failed:
     echo "$output"
     COVERAGE_FAILED=1

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk alyssawilk marked this pull request as ready for review December 14, 2022 16:40
@alyssawilk alyssawilk merged commit 715adb2 into envoyproxy:main Dec 14, 2022
jpsim added a commit that referenced this pull request Dec 14, 2022
…-tools

* origin/main: (59 commits)
  Make IsOkAndHolds matcher work with submatchers (#24498)
  ios: fix platform key value store (#24532)
  make ClusterInfo::traffic_stats_ a unique_ptr, so that later we can lazy-init it later. (#24406)
  quic: splitting into client and server (#24513)
  fixing coverage (#24529)
  ci: Add `examplesOnly` condition (#24465)
  ci: sonatype_nexus_upload.py: remove unused format argument (#24471)
  deps: Bump `build_bazel_rules_apple` -> 1.1.3 (#24527)
  deps: Bump `com_github_nghttp2_nghttp2` -> 1.51.0 (#24525)
  deps: Bump `rules_license` -> 0.0.4 (#24523)
  build(deps): bump sphinxcontrib-httpdomain from 1.8.0 to 1.8.1 in /mobile/docs (#24126)
  build(deps): bump github/codeql-action from 2.1.35 to 2.1.36 (#24473)
  build(deps): bump openpolicyagent/opa from 0.47.2-istio to 0.47.3-istio in /examples/ext_authz (#24514)
  build(deps): bump node from `80844b6` to `2770c78` in /examples/ext_authz/auth/http-service (#24515)
  build(deps): bump abseil-cpp to latest version (#24386)
  xDS: add xDS config tracker extension point (#23485)
  kafka: add shared consumer manager (#24494)
  coverage: Improve test coverage (#24355)
  deps: Bump `rules_python` -> 0.16.1 (#24344)
  ci: revert disable running the Objective-C integration app (#24478)" (#24496)
  ...

Signed-off-by: JP Simard <jp@jpsim.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants