Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #46

Merged
merged 7 commits into from
Jul 19, 2023
Merged

Dev #46

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: PHPUnit for motan-php
on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev
jobs:
testing:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: [7.2, 7.3, 7.4]
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install php
uses: shivammathur/setup-php@v2
env:
runner: self-hosted
with:
php-version: ${{ matrix.php-versions }}

- name: Install dependencies
run: composer install --ignore-platform-reqs

- name: Run tests
run: composer test

codecov:
runs-on: ubuntu-latest
steps:
- name: Set php
uses: shivammathur/setup-php@v2
env:
runner: self-hosted
with:
php-version: 7.4
coverage: pcov

- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: composer install --ignore-platform-reqs

- name: Generate coverage report
run: composer test-coverage

- name: Uplaod coverage report
uses: codecov/codecov-action@v2.1.0
with:
token: "fe6d871b-9785-470b-9c3d-eb1669fcb2ef"
file: ./tests/coverage/clover.xml
flags: unittests
name: codecov-umbrella
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ core.*
pretty/zj
tests/coverage/
zjtest_*
.phpunit.result.cache

# weibo-mesh
./agent_runtime
Expand All @@ -34,4 +35,5 @@ weibo-mesh-runpath/*
agent.pid

# debugger
.gdb*
.gdb*
/tests/MockServer/log.txt
48 changes: 0 additions & 48 deletions .travis.yml

This file was deleted.

37 changes: 33 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Motan-PHP
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/weibocom/motan/blob/master/LICENSE)
[![https://travis-ci.org/weibocom/motan-php.svg?branch=master](https://travis-ci.org/weibocom/motan-php.svg?branch=master)](https://travis-ci.org/weibocom/motan-php)
[![codecov](https://codecov.io/gh/weibocom/motan-php/branch/master/graph/badge.svg)](https://codecov.io/gh/weibocom/motan-php)
[![PHPUnit for motan-php](https://github.com/weibocom/motan-php/workflows/PHPUnit%20for%20motan-php/badge.svg)](https://github.com/weibocom/motan-php/actions)

# Overview
[Motan][motan] is a cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.
Expand Down Expand Up @@ -83,17 +84,45 @@ try{
}
```

# Unit Test

If you use the local php environment to run unit tests, please make sure that your php version is between 7.2 and 7.4, supports functions such as pcntl_fork, posix_kill, pcntl_signal, etc., and downloaded the composer component.
You can run unit tests by following the instructions below。
```shell
git clone https://github.com/weibocom/motan-php.git
cd motan-php
git checkout $(test branch)
composer install
composer test # just run phpunit
composer test-coverage # run phpunit and generate report
```

If you do not want to install a php-related environment, it is recommended that you use docker to avoid problems with inconsistent environments.
You can follow the instructions below.
```shell
git clone https://github.com/weibocom/motan-php.git
cd motan-php
git checkout $(test branch)
docker run --rm -it -v $PWD:/mnt --entrypoint="" snail007/php:7.4 bash
cd /mnt
composer install
composer test # just run phpunit
composer test-coverage # run phpunit and generate report
```

# Contributors

* 周晶([@idevz](https://github.com/idevz))
* 罗明刚[@lion2luo](https://github.com/lion2luo)
* 罗明刚([@lion2luo](https://github.com/lion2luo))
* 郭万韬
* 丁振凯
* 李枨煊([@flyhope](https://github.com/flyhope))
* 吴桦([@cocowh](https://github.com/cocowh))

# License

Motan is released under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).

[motan]:https://github.com/weibocom/motan
[testhelper]:https://github.com/weibo-mesh/testhelpers
[phpts]:https://github.com/weibocom/motan-php/tree/master/phpts/Motan_MClient

Welcome to submit issue and contribute code!
16 changes: 7 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "motan/motan-php",
"version": "v1.1.8",
"version": "v1.1.9",
"description": "Motan For PHP",
"autoload": {
"psr-4": {
Expand All @@ -10,16 +10,14 @@
"bin": [
"weibo-protoc-gen-php.php"
],
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.phpcomposer.com"
}
},
"require-dev": {
"phpunit/phpunit": "5.7"
"phpunit/phpunit": "^8.0"
},
"require": {
"wei-breeze/breeze": "v0.1.0"
},
"scripts": {
"test": "phpunit --testdox tests",
"test-coverage": "phpunit --testdox tests --coverage-html tests/coverage --coverage-clover tests/coverage/clover.xml"
}
}
}
32 changes: 0 additions & 32 deletions phpts/Motan_Client/__call_basic.phpt

This file was deleted.

29 changes: 0 additions & 29 deletions phpts/Motan_Client/doCall_basic.phpt

This file was deleted.

33 changes: 0 additions & 33 deletions phpts/Motan_Client/doCall_cacheService_basic.phpt

This file was deleted.

28 changes: 0 additions & 28 deletions phpts/Motan_Client/doCall_multi_args_basic.phpt

This file was deleted.

31 changes: 0 additions & 31 deletions phpts/Motan_Client/getEndPoint_basic.phpt

This file was deleted.

Loading
Loading