Skip to content

Commit

Permalink
Fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthab committed Mar 20, 2024
1 parent ee170a7 commit 0e8ca58
Show file tree
Hide file tree
Showing 17 changed files with 65 additions and 104 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -63,5 +64,5 @@ jobs:
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: archive-debug-artifacts
name: archive-debug-artifacts-${{ matrix.os }}-${{ matrix.bazel_version }}-${{ matrix.r_version }}
path: /tmp/debug-artifacts/*
2 changes: 1 addition & 1 deletion tests/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ build --java_runtime_version=remotejdk_11

build --action_env=ZERO_AR_DATE=1 # https://github.com/bazelbuild/bazel/issues/10886

try-import buildbuddy.bazelrc
try-import %workspace%/buildbuddy.bazelrc
8 changes: 4 additions & 4 deletions tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ r_toolchain(
toolchain(
name = "toolchain-linux",
exec_compatible_with = [
"@bazel_tools//platforms:linux",
"@platforms//os:linux",
],
target_compatible_with = [
"@bazel_tools//platforms:linux",
"@platforms//os:linux",
],
toolchain = ":r-toolchain-linux",
toolchain_type = "@rules_r//R:toolchain_type",
Expand All @@ -127,10 +127,10 @@ toolchain(
toolchain(
name = "toolchain-darwin",
exec_compatible_with = [
"@bazel_tools//platforms:osx",
"@platforms//os:osx",
],
target_compatible_with = [
"@bazel_tools//platforms:osx",
"@platforms//os:osx",
],
toolchain = ":r-toolchain-darwin",
toolchain_type = "@rules_r//R:toolchain_type",
Expand Down
13 changes: 6 additions & 7 deletions tests/buildbuddy.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
# https://app.buildbuddy.io/docs/setup/
# https://docs.buildbuddy.io/docs/rbe-github-actions/
build --bes_results_url=https://app.buildbuddy.io/invocation/
build --bes_backend=grpcs://cloud.buildbuddy.io
build --remote_cache=grpcs://cloud.buildbuddy.io
build --bes_backend=grpcs://remote.buildbuddy.io
build --remote_cache=grpcs://remote.buildbuddy.io
build --remote_timeout=3600

# Possibly giving issues with bazel 5.0.0 with messages like:
# Exec failed due to IOException: 643 errors during bulk transfer
# Possible cause: https://github.com/bazelbuild/bazel/issues/14654
#build --remote_download_outputs=toplevel
build --experimental_remote_cache_compression
build --nolegacy_important_outputs
build --build_metadata=VISIBILITY=PUBLIC
build --remote_upload_local_results

# Use Buildbuddy with auth if this file is present, else unauthenticated.
try-import auth.bazelrc
35 changes: 9 additions & 26 deletions tests/coverage/all_instrumented_C.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage line-rate="1" branch-rate="0" lines-covered="31" lines-valid="31" branches-covered="0" branches-valid="0" complexity="0" version="3.5.1" timestamp="1960-01-01 00:00:00">
<!DOCTYPE coverage SYSTEM "https://raw.githubusercontent.com/cobertura/cobertura/master/cobertura/src/site/htdocs/xml/coverage-04.dtd">
<coverage line-rate="1" branch-rate="0" lines-covered="23" lines-valid="23" branches-covered="0" branches-valid="0" complexity="0" version="3.6.4" timestamp="1960-01-01 00:00:00">
<sources/>
<packages>
<package name="NULL" line-rate="1" branch-rate="0" complexity="0">
<classes>
<class name="fn.R" filename="external/workspaceroot/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="hello" signature="" line-rate="1" branch-rate="0">
<method name="hello" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="1" branch="false"/>
</lines>
</method>
<method name="helloC" signature="" line-rate="1" branch-rate="0">
<method name="helloC" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="20" hits="1" branch="false"/>
</lines>
Expand All @@ -30,7 +31,7 @@
</class>
<class name="fn.R" filename="packages/exampleA/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="exampleA" signature="" line-rate="1" branch-rate="0">
<method name="exampleA" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="2" branch="false"/>
</lines>
Expand All @@ -42,7 +43,7 @@
</class>
<class name="fn.R" filename="packages/exampleB/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="exampleB" signature="" line-rate="1" branch-rate="0">
<method name="exampleB" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="2" branch="false"/>
</lines>
Expand All @@ -54,7 +55,7 @@
</class>
<class name="fn.R" filename="packages/exampleC/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="exampleC" signature="" line-rate="1" branch-rate="0">
<method name="exampleC" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="1" branch="false"/>
</lines>
Expand All @@ -66,12 +67,12 @@
</class>
<class name="rcpp.R" filename="packages/exampleC/R/rcpp.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="rcppHello" signature="" line-rate="1" branch-rate="0">
<method name="rcppHello" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="2" branch="false"/>
</lines>
</method>
<method name="rcppHelloWrapped" signature="" line-rate="1" branch-rate="0">
<method name="rcppHelloWrapped" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="20" hits="2" branch="false"/>
</lines>
Expand Down Expand Up @@ -106,24 +107,6 @@
<line number="19" hits="1" branch="false"/>
</lines>
</class>
<class name="getCharacter.c" filename="packages/exampleC/src/lib/getCharacter.c" line-rate="1" branch-rate="0" complexity="0">
<methods/>
<lines>
<line number="17" hits="1" branch="false"/>
</lines>
</class>
<class name="rcpp.cc" filename="packages/exampleC/src/lib/rcpp.cc" line-rate="1" branch-rate="0" complexity="0">
<methods/>
<lines>
<line number="20" hits="4" branch="false"/>
<line number="21" hits="4" branch="false"/>
<line number="28" hits="4" branch="false"/>
<line number="33" hits="2" branch="false"/>
<line number="40" hits="2" branch="false"/>
<line number="41" hits="2" branch="false"/>
<line number="42" hits="2" branch="false"/>
</lines>
</class>
<class name="rcpp.cc" filename="packages/exampleC/src/rcpp.cc" line-rate="1" branch-rate="0" complexity="0">
<methods/>
<lines>
Expand Down
5 changes: 3 additions & 2 deletions tests/coverage/all_instrumented_D.xml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage line-rate="1" branch-rate="0" lines-covered="4" lines-valid="4" branches-covered="0" branches-valid="0" complexity="0" version="3.5.1" timestamp="1960-01-01 00:00:00">
<!DOCTYPE coverage SYSTEM "https://raw.githubusercontent.com/cobertura/cobertura/master/cobertura/src/site/htdocs/xml/coverage-04.dtd">
<coverage line-rate="1" branch-rate="0" lines-covered="4" lines-valid="4" branches-covered="0" branches-valid="0" complexity="0" version="3.6.4" timestamp="1960-01-01 00:00:00">
<sources/>
<packages>
<package name="NULL" line-rate="1" branch-rate="0" complexity="0">
<classes>
<class name="proto.R" filename="packages/exampleD/R/proto.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="proto" signature="" line-rate="1" branch-rate="0">
<method name="proto" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="1" branch="false"/>
<line number="17" hits="1" branch="false"/>
Expand Down
3 changes: 1 addition & 2 deletions tests/coverage/coverage_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ echo "=== Testing custom toolchain ==="
echo "Checking coverage results with the LLVM toolchain:"
toolchain_args=(
"--extra_toolchains=//:toolchain-${os}"
"--extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-${os}"
"--incompatible_enable_cc_toolchain_resolution"
"--extra_toolchains=@llvm_toolchain//:cc-toolchain-${bzl_arch}-${os}"
"--toolchain_resolution_debug=rules_r"
)
"${bazel}" coverage "${bazel_test_opts[@]}" "${toolchain_args[@]}" //...
Expand Down
9 changes: 5 additions & 4 deletions tests/coverage/custom_toolchain_C.xml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage line-rate="1" branch-rate="0" lines-covered="19" lines-valid="19" branches-covered="0" branches-valid="0" complexity="0" version="3.5.1" timestamp="1960-01-01 00:00:00">
<!DOCTYPE coverage SYSTEM "https://raw.githubusercontent.com/cobertura/cobertura/master/cobertura/src/site/htdocs/xml/coverage-04.dtd">
<coverage line-rate="1" branch-rate="0" lines-covered="19" lines-valid="19" branches-covered="0" branches-valid="0" complexity="0" version="3.6.4" timestamp="1960-01-01 00:00:00">
<sources/>
<packages>
<package name="NULL" line-rate="1" branch-rate="0" complexity="0">
<classes>
<class name="fn.R" filename="packages/exampleC/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="exampleC" signature="" line-rate="1" branch-rate="0">
<method name="exampleC" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="1" branch="false"/>
</lines>
Expand All @@ -18,12 +19,12 @@
</class>
<class name="rcpp.R" filename="packages/exampleC/R/rcpp.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="rcppHello" signature="" line-rate="1" branch-rate="0">
<method name="rcppHello" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="2" branch="false"/>
</lines>
</method>
<method name="rcppHelloWrapped" signature="" line-rate="1" branch-rate="0">
<method name="rcppHelloWrapped" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="20" hits="2" branch="false"/>
</lines>
Expand Down
5 changes: 3 additions & 2 deletions tests/coverage/custom_toolchain_D.xml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage line-rate="1" branch-rate="0" lines-covered="4" lines-valid="4" branches-covered="0" branches-valid="0" complexity="0" version="3.5.1" timestamp="1960-01-01 00:00:00">
<!DOCTYPE coverage SYSTEM "https://raw.githubusercontent.com/cobertura/cobertura/master/cobertura/src/site/htdocs/xml/coverage-04.dtd">
<coverage line-rate="1" branch-rate="0" lines-covered="4" lines-valid="4" branches-covered="0" branches-valid="0" complexity="0" version="3.6.4" timestamp="1960-01-01 00:00:00">
<sources/>
<packages>
<package name="NULL" line-rate="1" branch-rate="0" complexity="0">
<classes>
<class name="proto.R" filename="packages/exampleD/R/proto.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="proto" signature="" line-rate="1" branch-rate="0">
<method name="proto" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="1" branch="false"/>
<line number="17" hits="1" branch="false"/>
Expand Down
27 changes: 5 additions & 22 deletions tests/coverage/default_instrumented.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage line-rate="1" branch-rate="0" lines-covered="26" lines-valid="26" branches-covered="0" branches-valid="0" complexity="0" version="3.5.1" timestamp="1960-01-01 00:00:00">
<!DOCTYPE coverage SYSTEM "https://raw.githubusercontent.com/cobertura/cobertura/master/cobertura/src/site/htdocs/xml/coverage-04.dtd">
<coverage line-rate="1" branch-rate="0" lines-covered="18" lines-valid="18" branches-covered="0" branches-valid="0" complexity="0" version="3.6.4" timestamp="1960-01-01 00:00:00">
<sources/>
<packages>
<package name="NULL" line-rate="1" branch-rate="0" complexity="0">
<classes>
<class name="fn.R" filename="packages/exampleC/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="exampleC" signature="" line-rate="1" branch-rate="0">
<method name="exampleC" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="1" branch="false"/>
</lines>
Expand All @@ -18,12 +19,12 @@
</class>
<class name="rcpp.R" filename="packages/exampleC/R/rcpp.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="rcppHello" signature="" line-rate="1" branch-rate="0">
<method name="rcppHello" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="2" branch="false"/>
</lines>
</method>
<method name="rcppHelloWrapped" signature="" line-rate="1" branch-rate="0">
<method name="rcppHelloWrapped" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="20" hits="2" branch="false"/>
</lines>
Expand Down Expand Up @@ -58,24 +59,6 @@
<line number="19" hits="1" branch="false"/>
</lines>
</class>
<class name="getCharacter.c" filename="packages/exampleC/src/lib/getCharacter.c" line-rate="1" branch-rate="0" complexity="0">
<methods/>
<lines>
<line number="17" hits="1" branch="false"/>
</lines>
</class>
<class name="rcpp.cc" filename="packages/exampleC/src/lib/rcpp.cc" line-rate="1" branch-rate="0" complexity="0">
<methods/>
<lines>
<line number="20" hits="4" branch="false"/>
<line number="21" hits="4" branch="false"/>
<line number="28" hits="4" branch="false"/>
<line number="33" hits="2" branch="false"/>
<line number="40" hits="2" branch="false"/>
<line number="41" hits="2" branch="false"/>
<line number="42" hits="2" branch="false"/>
</lines>
</class>
<class name="rcpp.cc" filename="packages/exampleC/src/rcpp.cc" line-rate="1" branch-rate="0" complexity="0">
<methods/>
<lines>
Expand Down
31 changes: 7 additions & 24 deletions tests/coverage/workspace_instrumented_C.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage line-rate="1" branch-rate="0" lines-covered="28" lines-valid="28" branches-covered="0" branches-valid="0" complexity="0" version="3.5.1" timestamp="1960-01-01 00:00:00">
<!DOCTYPE coverage SYSTEM "https://raw.githubusercontent.com/cobertura/cobertura/master/cobertura/src/site/htdocs/xml/coverage-04.dtd">
<coverage line-rate="1" branch-rate="0" lines-covered="20" lines-valid="20" branches-covered="0" branches-valid="0" complexity="0" version="3.6.4" timestamp="1960-01-01 00:00:00">
<sources/>
<packages>
<package name="NULL" line-rate="1" branch-rate="0" complexity="0">
<classes>
<class name="fn.R" filename="packages/exampleA/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="exampleA" signature="" line-rate="1" branch-rate="0">
<method name="exampleA" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="2" branch="false"/>
</lines>
Expand All @@ -18,7 +19,7 @@
</class>
<class name="fn.R" filename="packages/exampleB/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="exampleB" signature="" line-rate="1" branch-rate="0">
<method name="exampleB" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="2" branch="false"/>
</lines>
Expand All @@ -30,7 +31,7 @@
</class>
<class name="fn.R" filename="packages/exampleC/R/fn.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="exampleC" signature="" line-rate="1" branch-rate="0">
<method name="exampleC" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="1" branch="false"/>
</lines>
Expand All @@ -42,12 +43,12 @@
</class>
<class name="rcpp.R" filename="packages/exampleC/R/rcpp.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="rcppHello" signature="" line-rate="1" branch-rate="0">
<method name="rcppHello" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="2" branch="false"/>
</lines>
</method>
<method name="rcppHelloWrapped" signature="" line-rate="1" branch-rate="0">
<method name="rcppHelloWrapped" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="20" hits="2" branch="false"/>
</lines>
Expand Down Expand Up @@ -82,24 +83,6 @@
<line number="19" hits="1" branch="false"/>
</lines>
</class>
<class name="getCharacter.c" filename="packages/exampleC/src/lib/getCharacter.c" line-rate="1" branch-rate="0" complexity="0">
<methods/>
<lines>
<line number="17" hits="1" branch="false"/>
</lines>
</class>
<class name="rcpp.cc" filename="packages/exampleC/src/lib/rcpp.cc" line-rate="1" branch-rate="0" complexity="0">
<methods/>
<lines>
<line number="20" hits="4" branch="false"/>
<line number="21" hits="4" branch="false"/>
<line number="28" hits="4" branch="false"/>
<line number="33" hits="2" branch="false"/>
<line number="40" hits="2" branch="false"/>
<line number="41" hits="2" branch="false"/>
<line number="42" hits="2" branch="false"/>
</lines>
</class>
<class name="rcpp.cc" filename="packages/exampleC/src/rcpp.cc" line-rate="1" branch-rate="0" complexity="0">
<methods/>
<lines>
Expand Down
5 changes: 3 additions & 2 deletions tests/coverage/workspace_instrumented_D.xml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage line-rate="1" branch-rate="0" lines-covered="4" lines-valid="4" branches-covered="0" branches-valid="0" complexity="0" version="3.5.1" timestamp="1960-01-01 00:00:00">
<!DOCTYPE coverage SYSTEM "https://raw.githubusercontent.com/cobertura/cobertura/master/cobertura/src/site/htdocs/xml/coverage-04.dtd">
<coverage line-rate="1" branch-rate="0" lines-covered="4" lines-valid="4" branches-covered="0" branches-valid="0" complexity="0" version="3.6.4" timestamp="1960-01-01 00:00:00">
<sources/>
<packages>
<package name="NULL" line-rate="1" branch-rate="0" complexity="0">
<classes>
<class name="proto.R" filename="packages/exampleD/R/proto.R" line-rate="1" branch-rate="0" complexity="0">
<methods>
<method name="proto" signature="" line-rate="1" branch-rate="0">
<method name="proto" signature="" line-rate="1" branch-rate="0" complexity="0">
<lines>
<line number="16" hits="1" branch="false"/>
<line number="17" hits="1" branch="false"/>
Expand Down
Loading

0 comments on commit 0e8ca58

Please sign in to comment.