Skip to content

Commit

Permalink
Fix xplat OpenSSLCertUtilsTest/OpenSSLCertUtilsTest.TestX509* tests
Browse files Browse the repository at this point in the history
Summary:
This change aliases the .pem resource files to the xplat OpenSSLCertUtilsTest/OpenSSLCertUtilsTest.TestX509* tests.

The tests were failing because the .pem resources were not provided to the test. This happened because the `resources` parameter of the `folly_cxx_test` macro was not passed down to `native.cxx_test`.

The changes to the `BUCK` files closely match the code used in `TARGETS`. They do not completely match because there are xplat targets that rely on `//xplat/folly/io/async/test:cert`. This change puts the export_file of `*.pem` files into `//xplat/folly/io/async/test` instead of `//xplat/folly/io/async/test/certs` because causes a conflict with a tupperware target.

I remove the conditional logic around FOLLY_REPO done in D56953408 because it is no longer required with `resources`.

Reviewed By: Gownta

Differential Revision: D57178724

fbshipit-source-id: 063c603084bf52854e15d7cd36e0918da019f46c
  • Loading branch information
Simon Krueger authored and facebook-github-bot committed May 21, 2024
1 parent 95fd854 commit 949ecec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions folly/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,17 @@ def folly_cxx_test(
deps = [],
contacts = [],
**kwargs):
# resources is cherry picked because some of the other kwargs
# have issues that need to be investigated.
# e.g., Some args are duplicated. Some args cause TSAN errors.
# TODO(T188948036): Fix xplat/folly:folly-futures-test and folly_cxx_test
resources = kwargs.get("resources", [])

fb_xplat_cxx_test(
name = name,
srcs = srcs,
raw_headers = raw_headers,
resources = resources,
include_directories = _compute_include_directories(),
deps = deps + [
"//xplat/folly/test/common:test_main",
Expand Down
8 changes: 8 additions & 0 deletions folly/io/async/test/certs/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@ def alias_pem(pems: list[str]):
name = pem,
actual = "//folly/io/async/test/certs:{pem}".format(pem = pem),
)

def alias_pem_for_xplat(pems: list[str]):
# in xplat these pem files are exported in //xplat/folly/io/async/test
for pem in pems:
alias(
name = pem,
actual = "//xplat/folly/io/async/test:certs/{pem}".format(pem = pem),
)

0 comments on commit 949ecec

Please sign in to comment.