diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index bcfbcad..eaa2b12 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -174,15 +174,23 @@ jobs: - name: Composer install run: composer install --working-dir=tests/php - # Build mixture for cargo test. - - name: Docker compose - if: matrix.os == 'ubuntu-20.04' - run: docker compose up -d + - name: Setup docker (missing on MacOS) + if: matrix.os == 'macos-12' + run: | + brew install docker + brew install docker-compose + mkdir -p ~/.docker/cli-plugins + ln -sfn $(brew --prefix)/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose + + colima start + + # For test containers to find the Colima socket + # https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running + sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock # Build mixture for cargo test. - - name: Vagrant up for docker compose - if: matrix.os == 'macos-12' - run: vagrant up + - name: Docker compose + run: docker compose up -d --wait # Try cargo test. - name: Cargo test @@ -198,14 +206,9 @@ jobs: # Rebuild the mixture when cargo test failed. - name: Docker compose restart - if: matrix.os == 'ubuntu-20.04' && steps.cargo-test-step.outcome != 'success' + if: steps.cargo-test-step.outcome != 'success' run: docker compose restart - # Rebuild the mixture when cargo test failed. - - name: Vagrant reload for docker compose - if: matrix.os == 'macos-12' && steps.cargo-test-step.outcome != 'success' - run: vagrant reload - # Delay before retry. - name: Delay if: steps.cargo-test-step.outcome != 'success' diff --git a/Cargo.lock b/Cargo.lock index 6097847..fb1e6dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2099,7 +2099,7 @@ dependencies = [ [[package]] name = "skywalking-php" -version = "0.7.0" +version = "0.8.0-dev" dependencies = [ "anyhow", "axum", diff --git a/Cargo.toml b/Cargo.toml index 774d6cd..5647050 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ members = [ [package] name = "skywalking-php" -version = "0.7.0" +version = "0.8.0-dev" authors = ["Apache Software Foundation", "jmjoy ", "Yanlong He "] description = "Apache SkyWalking PHP Agent." edition = "2021" diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index b58e0aa..0000000 --- a/Vagrantfile +++ /dev/null @@ -1,38 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -Vagrant.configure("2") do |config| - config.vm.box = "generic/alpine316" - config.vm.box_version = "4.1.10" - config.vm.box_check_update = false - - config.vm.network "forwarded_port", guest: 19876, host: 19876 - config.vm.network "forwarded_port", guest: 12800, host: 12800 - config.vm.network "forwarded_port", guest: 3306, host: 3306 - config.vm.network "forwarded_port", guest: 6379, host: 6379 - config.vm.network "forwarded_port", guest: 11211, host: 11211 - config.vm.network "forwarded_port", guest: 5672, host: 5672 - config.vm.network "forwarded_port", guest: 27017, host: 27017 - - config.vm.synced_folder ".", "/vagrant" - - config.vm.provision "shell", inline: <<-SHELL - apk add --no-cache docker docker-cli-compose - service docker restart - sleep 3 - cd /vagrant - sudo docker compose up -d - SHELL -end diff --git a/docker-compose.yml b/docker-compose.yml index 3cc802f..228b29d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,8 +21,9 @@ services: - "12800:12800" healthcheck: test: [ "CMD", "curl", "http://127.0.0.1:12800/healthCheck" ] - interval: 5s + interval: 10s timeout: 5s + retries: 10 mysql: image: mysql:5.7.39 @@ -45,12 +46,17 @@ services: - "11211:11211" rabbitmq: - image: rabbitmq:3.11.13 + image: rabbitmq:3.12.8 ports: - "5672:5672" environment: - RABBITMQ_DEFAULT_USER=guest - RABBITMQ_DEFAULT_PASS=guest + healthcheck: + test: [ "CMD", "rabbitmq-diagnostics", "check_running" ] + interval: 10s + timeout: 5s + retries: 10 mongo: image: mongo:4.4.10 diff --git a/src/plugin/plugin_swoole.rs b/src/plugin/plugin_swoole.rs index d405388..c8f4485 100644 --- a/src/plugin/plugin_swoole.rs +++ b/src/plugin/plugin_swoole.rs @@ -55,7 +55,12 @@ impl SwooleServerPlugin { validate_num_args(execute_data, 2)?; let on = execute_data.get_parameter(0); - if !on.as_z_str().map(|s| s == b"request").unwrap_or_default() { + if !on + .as_z_str() + .and_then(|s| s.to_str().ok()) + .map(|s| s.to_lowercase() == "request") + .unwrap_or_default() + { return Ok(Box::new(())); }