MCPcopy Create free account
hub / github.com/apache/skywalking-php / setup_php_swoole

Function setup_php_swoole

tests/common/mod.rs:335–379  ·  view source on GitHub ↗
(index: usize)

Source from the content-addressed store, hash-verified

333
334#[instrument]
335fn setup_php_swoole(index: usize) -> Child {
336 let php = env::var("PHP_BIN").unwrap_or_else(|_| "php".to_string());
337 let args = [
338 &php,
339 // "-n",
340 // "-c",
341 // "tests/conf/php.ini",
342 "-d",
343 &format!("extension=target/{}/libskywalking_agent{}", TARGET, EXT),
344 "-d",
345 "skywalking_agent.enable=On",
346 "-d",
347 &format!(
348 "skywalking_agent.service_name=skywalking-agent-test-{}-swoole",
349 index
350 ),
351 "-d",
352 &format!("skywalking_agent.server_addr={}", COLLECTOR_GRPC_ADDRESS),
353 "-d",
354 &format!("skywalking_agent.log_level={}", PROCESS_LOG_LEVEL),
355 "-d",
356 &format!(
357 "skywalking_agent.log_file=/tmp/swoole-skywalking-agent.{}.log",
358 index
359 ),
360 "-d",
361 "skywalking.worker_threads=3",
362 "-d",
363 &format!(
364 "skywalking_agent.enable_zend_observer={}",
365 *ENABLE_ZEND_OBSERVER
366 ),
367 &format!("tests/php/swoole/main.{}.php", index),
368 ];
369 info!(cmd = args.join(" "), "start command");
370 let child = Command::new(args[0])
371 .args(&args[1..])
372 .stdin(Stdio::null())
373 .stdout(File::create("/tmp/swoole-skywalking-stdout.log").unwrap())
374 .stderr(File::create("/tmp/swoole-skywalking-stderr.log").unwrap())
375 .spawn()
376 .unwrap();
377 thread::sleep(Duration::from_secs(3));
378 child
379}
380
381async fn kill_command(mut child: Child) -> io::Result<ExitStatus> {
382 if let Some(id) = child.id() {

Callers 1

setupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected