Skip to content

Commit 79a583a

Browse files
authored
version 2 prototype (via #78)
1 parent 65b97e1 commit 79a583a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2698
-926
lines changed

.gitattributes

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Define the line ending behavior of the different file extensions
2+
# Set default behavior, in case users don't have core.autocrlf set.
3+
* text text=auto eol=lf
4+
5+
.php diff=php
6+
7+
# Declare files that will always have CRLF line endings on checkout.
8+
*.bat eol=crlf
9+
10+
# Declare files that will always have LF line endings on checkout.
11+
*.pem eol=lf
12+
13+
# Denote all files that are truly binary and should not be modified.
14+
*.png binary
15+
*.jpg binary
16+
*.gif binary
17+
*.ico binary
18+
*.mo binary
19+
*.pdf binary
20+
*.phar binary
21+
*.woff binary
22+
*.woff2 binary
23+
*.ttf binary
24+
*.otf binary
25+
*.eot binary

.github/workflows/build.yml

Lines changed: 40 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -10,68 +10,48 @@ on:
1010
- 'hotfix-*'
1111

1212
jobs:
13-
build71:
14-
runs-on: ubuntu-latest
13+
tests:
14+
name: PHP ${{ matrix.php-version }} on ${{ matrix.os }} (${{ matrix.composer-options }})
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
php-version:
20+
- "8.0"
21+
- "8.1"
22+
os:
23+
- ubuntu-latest
24+
- windows-latest
25+
- macOS-latest
26+
composer-options:
27+
- ""
28+
- "--prefer-lowest"
1529
steps:
16-
- uses: actions/checkout@v2.3.4
17-
- uses: shivammathur/setup-php@2.14.0
18-
with:
19-
php-version: '7.1.3'
20-
- name: Install
21-
run: composer install
22-
- name: Install
23-
run: composer validate
24-
- name: Test
25-
run: composer test
26-
build72:
27-
runs-on: ubuntu-latest
28-
steps:
29-
- uses: actions/checkout@v2.3.4
30-
- uses: shivammathur/setup-php@2.14.0
31-
with:
32-
php-version: '7.2'
33-
- name: Install
34-
run: composer install
35-
- name: Install
36-
run: composer validate
37-
- name: Test
38-
run: composer test
39-
build73:
40-
runs-on: ubuntu-latest
41-
steps:
42-
- uses: actions/checkout@v2.3.4
43-
- uses: shivammathur/setup-php@2.14.0
44-
with:
45-
php-version: '7.3'
46-
- name: Install
47-
run: composer install
48-
- name: Install
30+
- name: Checkout
31+
uses: actions/checkout@v2.3.4
32+
33+
- name: Validate composer.json and composer.lock
4934
run: composer validate
50-
- name: Test
51-
run: composer test
52-
build74:
53-
runs-on: ubuntu-latest
54-
steps:
55-
- uses: actions/checkout@v2.3.4
56-
- uses: shivammathur/setup-php@2.14.0
35+
36+
- name: Set up PHP ${{ matrix.php-version }}
37+
uses: shivammathur/setup-php@v2
5738
with:
58-
php-version: '7.4'
59-
- name: Install
60-
run: composer install
61-
- name: Install
62-
run: composer validate
63-
- name: Test
39+
php-version: ${{ matrix.php-version }}
40+
extensions: pcntl, posix, intl
41+
coverage: xdebug
42+
ini-values: error_reporting=E_ALL
43+
44+
- name: Install dependencies
45+
run: composer update
46+
--prefer-dist
47+
--no-progress
48+
${{ matrix.composer-options }}
49+
50+
- name: Run tests
51+
if: ${{ matrix.php-version != '8.1' }}
6452
run: composer test
65-
build80:
66-
runs-on: ubuntu-latest
67-
steps:
68-
- uses: actions/checkout@v2.3.4
69-
- uses: shivammathur/setup-php@2.14.0
70-
with:
71-
php-version: '8.0'
72-
- name: Install
73-
run: composer install
74-
- name: Install
75-
run: composer validate
76-
- name: Test
53+
54+
- name: Run tests (experimental)
55+
if: ${{ matrix.php-version == '8.1' }}
56+
continue-on-error: true
7757
run: composer test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ vendor/*
44
composer.phar
55
composer.lock
66
/build/
7+
/test/codeception/_support/_generated/
78
.phpunit.result.cache
89

README.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Allure Codeception Adapter
22

3+
[![Latest Stable Version](http://poser.pugx.org/allure-framework/allure-codeception/v)](https://packagist.org/packages/allure-framework/allure-codeception)
34
[![Build](https://github.com/allure-framework/allure-codeception/actions/workflows/build.yml/badge.svg)](https://github.com/allure-framework/allure-codeception/actions/workflows/build.yml)
5+
[![Type Coverage](https://shepherd.dev/github/allure-framework/allure-codeception/coverage.svg)](https://shepherd.dev/github/allure-framework/allure-codeception)
6+
[![Psalm Level](https://shepherd.dev/github/allure-framework/allure-codeception/level.svg)](https://shepherd.dev/github/allure-framework/allure-codeception)
7+
[![Total Downloads](http://poser.pugx.org/allure-framework/allure-codeception/downloads)](https://packagist.org/packages/allure-framework/allure-codeception)
8+
[![License](http://poser.pugx.org/allure-framework/allure-codeception/license)](https://packagist.org/packages/allure-framework/allure-codeception)
49

510
This is an official [Codeception](http://codeception.com) adapter for Allure Framework.
611

@@ -15,45 +20,36 @@ In order to use this adapter you need to add a new dependency to your **composer
1520
```
1621
{
1722
"require": {
18-
"php": ">=5.4.0",
19-
"allure-framework/allure-codeception": ">=1.1.0"
23+
"php": "^8",
24+
"allure-framework/allure-codeception": "^2"
2025
}
2126
}
2227
```
2328
To enable this adapter in Codeception tests simply put it in "enabled" extensions section of **codeception.yml**:
2429
```yaml
2530
extensions:
2631
enabled:
27-
- Yandex\Allure\Codeception\AllureCodeception
32+
- Qameta\Allure\Codeception\AllureCodeception
2833
config:
29-
Yandex\Allure\Codeception\AllureCodeception:
30-
deletePreviousResults: false
34+
Qameta\Allure\Codeception\AllureCodeception:
3135
outputDirectory: allure-results
32-
ignoredAnnotations:
33-
- env
34-
- dataprovider
3536
```
3637
37-
`deletePreviousResults` will clear all `.xml` files from output directory (this
38-
behavior may change to complete cleanup later). It is set to `false` by default.
39-
4038
`outputDirectory` is used to store Allure results and will be calculated
4139
relatively to Codeception output directory (also known as `paths: log` in
4240
codeception.yml) unless you specify an absolute path. You can traverse up using
4341
`..` as usual. `outputDirectory` defaults to `allure-results`.
4442

45-
`ignoredAnnotations` is used to define extra custom annotations to ignore. It is empty by default.
46-
4743
To generate report from your favourite terminal,
4844
[install](https://github.com/allure-framework/allure-cli#installation)
4945
allure-cli and run following command (assuming you're in project root and using
5046
default configuration):
5147

5248
```bash
53-
allure generate --report-version 1.4.5 --report-path tests/_output/allure-report -- tests/_output/allure-results
49+
allure generate -o ./build/allure-report ./build/allure-results
5450
```
5551

56-
Report will be generated in `tests/_output/allure-report`.
52+
Report will be generated in `build/allure-report`.
5753

5854
## Main features
5955
See respective [PHPUnit](https://github.com/allure-framework/allure-phpunit#advanced-features) section.

codeception.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
1-
namespace: Yandex\Allure\Codeception
2-
suites:
3-
unit:
4-
path: .
1+
namespace: Qameta\Allure\Codeception\Test
52

63
settings:
74
lint: true
85
paths:
96
tests: test/codeception
107
output: build
118
support: test/codeception/_support
12-
data: test/codeception
9+
data: test/codeception/_data
1310
extensions:
1411
enabled:
15-
- Yandex\Allure\Codeception\AllureCodeception
12+
- Qameta\Allure\Codeception\AllureCodeception
1613
config:
17-
Yandex\Allure\Codeception\AllureCodeception:
18-
deletePreviousResults: true
14+
Qameta\Allure\Codeception\AllureCodeception:
1915
outputDirectory: allure-results
2016

2117

composer.json

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,45 +8,69 @@
88
{
99
"name": "Ivan Krutov",
1010
"email": "vania-pooh@aerokube.com",
11-
"role": "Developer"
11+
"role": "Developer"
12+
},
13+
{
14+
"name": "Edward Surov",
15+
"email": "zoohie@gmail.com",
16+
"role": "Developer"
1217
}
1318
],
1419
"support": {
1520
"email": "allure@qameta.io",
1621
"source": "https://github.com/allure-framework/allure-codeception"
1722
},
1823
"require": {
19-
"php": ">=7.1.3",
24+
"php": "^8",
2025
"ext-json": "*",
21-
"codeception/codeception": "^2.5 | ^3 | ^4",
22-
"allure-framework/allure-php-api": "^1.3",
23-
"symfony/filesystem": "^2.7 | ^3 | ^4 | ^5",
24-
"symfony/finder": "^2.7 | ^3 | ^4 | ^5"
26+
"codeception/codeception": "^4.1",
27+
"allure-framework/allure-php-commons": "2.0.0-rc3"
2528
},
2629
"require-dev": {
2730
"ext-dom": "*",
28-
"phpunit/phpunit": "^7.2 | ^8 | ^9"
31+
"phpunit/phpunit": "^9",
32+
"psalm/plugin-phpunit": "^0.16.1",
33+
"remorhaz/php-json-data": "^0.5.3",
34+
"remorhaz/php-json-path": "^0.7.7",
35+
"squizlabs/php_codesniffer": "^3.6.1",
36+
"vimeo/psalm": "^4.10"
37+
},
38+
"conflict": {
39+
"codeception/phpunit-wrapper": "<9.0.1"
2940
},
3041
"autoload": {
31-
"psr-0": {
32-
"Yandex": "src/"
42+
"psr-4": {
43+
"Qameta\\Allure\\Codeception\\": "src/"
3344
}
3445
},
3546
"autoload-dev": {
3647
"psr-4": {
37-
"Yandex\\Allure\\Codeception\\": [
38-
"test/report/",
39-
"test/unit/"
48+
"Qameta\\Allure\\Codeception\\Test\\Functional\\": "test/codeception/functional/",
49+
"Qameta\\Allure\\Codeception\\Test\\Acceptance\\": "test/codeception/acceptance/",
50+
"Qameta\\Allure\\Codeception\\Test\\Unit\\": "test/codeception/unit/",
51+
"Qameta\\Allure\\Codeception\\Test\\": [
52+
"test/codeception/_support/",
53+
"test/report/"
4054
]
4155
}
4256
},
4357
"scripts": {
44-
"test-report": [
45-
"vendor/bin/codecept run --no-exit --report",
46-
"vendor/bin/phpunit --testsuite=report"
58+
"build": [
59+
"vendor/bin/codecept build",
60+
"vendor/bin/codecept gherkin:snippets acceptance"
61+
],
62+
"test-cs": "vendor/bin/phpcs -sp",
63+
"test-report-generate": [
64+
"rm -rf ./build/log/",
65+
"vendor/bin/codecept run --no-exit --report"
4766
],
67+
"test-report-check": "vendor/bin/phpunit --testsuite=report",
68+
"test-psalm": "vendor/bin/psalm --shepherd",
4869
"test": [
49-
"@test-report"
70+
"@test-cs",
71+
"@test-report-generate",
72+
"@test-report-check",
73+
"@test-psalm"
5074
]
5175
}
5276
}

phpcs.xml.dist

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<ruleset name="Qameta Coding Standards">
3+
<description>Qameta Coding Standards</description>
4+
5+
<file>src</file>
6+
<file>test</file>
7+
8+
<arg name="colors"/>
9+
10+
<rule ref="PSR12" />
11+
12+
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
13+
<exclude-pattern>*/test/*Test.php</exclude-pattern>
14+
</rule>
15+
</ruleset>

phpunit.xml renamed to phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.2/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
55
colors="true"
66
defaultTestSuite="unit">
77
<testsuites>

psalm.xml.dist

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="1"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xmlns="https://getpsalm.org/schema/config"
6+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd">
7+
<projectFiles>
8+
<directory name="src"/>
9+
<directory name="test/report/"/>
10+
<ignoreFiles>
11+
<directory name="vendor"/>
12+
</ignoreFiles>
13+
</projectFiles>
14+
<plugins>
15+
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
16+
</plugins>
17+
</psalm>

0 commit comments

Comments
 (0)