New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 698042 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 3
Type: Task



Sign in to add a comment

BUILD.gn should explicitly declare bundle_data dependency if unittests depend on data files

Project Member Reported by zhongyi@chromium.org, Mar 2 2017

Issue description

ios will need to explicitly declare dependency if unittests or some such depends on data files.

We might want to add rules in the presubmit or build files to auto detect this. 

bundle_data("test_support_bundle_data") {
  visibility = [ ":test_support" ]
  testonly = true
  sources = [
    "data/ssl/certificates/1024-rsa-ee-by-1024-rsa-intermediate.pem",
    ...
  ]
  outputs = [
    "{{bundle_resources_dir}}/" +
        "{{source_root_relative_dir}}/{{source_file_part}}",
  ]
}

...

  if (is_ios) {
    deps += [ ":test_support_bundle_data" ]
  } else {
    public_deps += [ "//third_party/protobuf:py_proto" ]
  }
 
Cc: ckrasic@chromium.org
Net triager here. Any owner for this?
I can put this in my queue unless someone else is interested in fixing this issue :-) 

Comment 4 by mef@chromium.org, Mar 6 2017

Labels: OS-iOS
Summary: BUILD.gn should explicitly declare bundle_data dependency if unittests depend on data files (was: BUILD.gn should )

Comment 5 by pkl@chromium.org, Mar 6 2017

Cc: sdefresne@chromium.org
Owner: zhongyi@chromium.org

Comment 6 by pkl@chromium.org, Mar 6 2017

Status: Assigned (was: Untriaged)
Owner: ----
Status: Untriaged (was: Assigned)
Unassigned myself on this bug as I don't have time to get on this. 

Comment 8 by eroman@chromium.org, Apr 24 2018

Labels: -Type-Bug Type-Feature
Status: Available (was: Untriaged)
Just to make sure I understand: this bug is about improving the developer ergonomics, so that we warn earlier when adding files that need to be explicitly defined for iOS? (as opposed to only failing once it hits the trybots/commitqueue and the iOS bots cant find the new file).

We have //net/tools/update_ios_bundle_data.py which can re-generate the iOS file list from some globbing rules, so it may be possible to simply run that on presubmit to see if there is a new file in one of the globbed paths.

That approach has its limitations though, and might not pass the bar for presubmit performance.

I think better solutions are to note this issue at runtime (like: "error: you read a test data file that wasn't enumerate in test_support_bundle") by changing how test code reads files, but maybe there is already something like this that was built for test isolation?
Labels: Network-Triaged
Labels: -Type-Feature Type-Task

Sign in to add a comment