fn make_execute_request_with_jdk_and_extra_platform_properties()

in src/rust/engine/process_execution/src/remote.rs [1225:1299]


  fn make_execute_request_with_jdk_and_extra_platform_properties() {
    let input_directory = TestDirectory::containing_roland();
    let req = ExecuteProcessRequest {
      argv: owned_string_vec(&["/bin/echo", "yo"]),
      env: BTreeMap::new(),
      input_files: input_directory.digest(),
      output_files: BTreeSet::new(),
      output_directories: BTreeSet::new(),
      timeout: Duration::from_millis(1000),
      description: "some description".to_owned(),
      jdk_home: Some(PathBuf::from("/tmp")),
    };

    let mut want_command = bazel_protos::remote_execution::Command::new();
    want_command.mut_arguments().push("/bin/echo".to_owned());
    want_command.mut_arguments().push("yo".to_owned());
    want_command.mut_platform().mut_properties().push({
      let mut property = bazel_protos::remote_execution::Platform_Property::new();
      property.set_name("FIRST".to_owned());
      property.set_value("foo".to_owned());
      property
    });
    want_command.mut_platform().mut_properties().push({
      let mut property = bazel_protos::remote_execution::Platform_Property::new();
      property.set_name("JDK_SYMLINK".to_owned());
      property.set_value(".jdk".to_owned());
      property
    });
    want_command.mut_platform().mut_properties().push({
      let mut property = bazel_protos::remote_execution::Platform_Property::new();
      property.set_name("last".to_owned());
      property.set_value("bar".to_owned());
      property
    });

    let mut want_action = bazel_protos::remote_execution::Action::new();
    want_action.set_command_digest(
      (&Digest(
        Fingerprint::from_hex_string(
          "a809e7c54a105e7d98cc61558ac13ca3c05a5e1cb33326dfde189c72887dac29",
        )
        .unwrap(),
        65,
      ))
        .into(),
    );
    want_action.set_input_root_digest((&input_directory.digest()).into());

    let mut want_execute_request = bazel_protos::remote_execution::ExecuteRequest::new();
    want_execute_request.set_action_digest(
      (&Digest(
        Fingerprint::from_hex_string(
          "3d8d2a0282cb45b365b338f80ddab039dfa461dadde053e12bd5c3ab3329d928",
        )
        .unwrap(),
        140,
      ))
        .into(),
    );

    assert_eq!(
      super::make_execute_request(
        &req,
        &None,
        &None,
        vec![
          ("FIRST".to_owned(), "foo".to_owned()),
          ("last".to_owned(), "bar".to_owned())
        ]
        .into_iter()
        .collect()
      ),
      Ok((want_action, want_command, want_execute_request))
    );
  }