Skip to content

Commit

Permalink
Add E2E tests (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Dec 10, 2022
1 parent b7efb38 commit 05dde06
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 4 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,84 @@ jobs:

- name: "Run Infection"
run: "make infection"

e2e-ubuntu:
name: "End-to-End tests Ubuntu"
runs-on: "ubuntu-latest"
strategy:
matrix:
php-version:
- "8.1"
steps:
- name: "Checkout"
uses: "actions/[email protected]"

- name: "Set up PHP"
uses: "shivammathur/[email protected]"
with:
coverage: "xdebug"
php-version: "${{ matrix.php-version }}"
tools: "phive"

- name: "Install Composer dependencies"
uses: "ramsey/composer-install@v2"

- name: "Setup the expected output"
run: "mv e2e/expected-output-ubuntu e2e/expected-output"

- name: "Run E2E tests"
run: "make e2e"

e2e-osx:
name: "End-to-End tests OSX"
runs-on: "macos-latest"
strategy:
matrix:
php-version:
- "8.1"
steps:
- name: "Checkout"
uses: "actions/[email protected]"

- name: "Set up PHP"
uses: "shivammathur/[email protected]"
with:
coverage: "xdebug"
php-version: "${{ matrix.php-version }}"
tools: "phive"

- name: "Install Composer dependencies"
uses: "ramsey/composer-install@v2"

- name: "Setup the expected output"
run: "mv e2e/expected-output-osx e2e/expected-output"

- name: "Run E2E tests"
run: "make e2e"

e2e-windows:
name: "End-to-End tests Windows"
runs-on: "windows-latest"
strategy:
matrix:
php-version:
- "8.1"
steps:
- name: "Checkout"
uses: "actions/[email protected]"

- name: "Set up PHP"
uses: "shivammathur/[email protected]"
with:
coverage: "xdebug"
php-version: "${{ matrix.php-version }}"
tools: "phive"

- name: "Install Composer dependencies"
uses: "ramsey/composer-install@v2"

- name: "Setup the expected output"
run: "mv e2e/expected-output-windows e2e/expected-output"

- name: "Run E2E tests"
run: "make e2e"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/.build/
/composer.lock
/e2e/actual-output
/e2e/expected-output
/tools/
/vendor/
6 changes: 4 additions & 2 deletions e2e/expected-output → e2e/expected-output-osx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ CpuInfoFinder: F
DummyCpuCoreFinder(value=1): .
HwLogicalFinder: .
HwPhysicalFinder: .
NProcFinder(all=true): .
NProcFinder(all=false): .
LinuxyNProcessorFinder: .
NProcessorFinder: .
NProcFinder(all=true): F
NProcFinder(all=false): F
NullCpuCoreFinder: F
WindowsWmicPhysicalFinder: F
WindowsWmicLogicalFinder: F
11 changes: 11 additions & 0 deletions e2e/expected-output-ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CpuInfoFinder: .
DummyCpuCoreFinder(value=1): .
HwLogicalFinder: F
HwPhysicalFinder: F
LinuxyNProcessorFinder: .
NProcessorFinder: F
NProcFinder(all=true): .
NProcFinder(all=false): .
NullCpuCoreFinder: F
WindowsWmicPhysicalFinder: F
WindowsWmicLogicalFinder: F
11 changes: 11 additions & 0 deletions e2e/expected-output-windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CpuInfoFinder: F
DummyCpuCoreFinder(value=1): .
HwLogicalFinder: F
HwPhysicalFinder: F
LinuxyNProcessorFinder: .
NProcessorFinder: F
NProcFinder(all=true): F
NProcFinder(all=false): F
NullCpuCoreFinder: F
WindowsWmicPhysicalFinder: F
WindowsWmicLogicalFinder: F
4 changes: 2 additions & 2 deletions e2e/test-finders.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/sh

execute_finders() {
php "$(pwd)/e2e/execute-finders.php"
php "$(pwd)/e2e/execute-finders.php" 2>&1
}

execute_finders > $(pwd)/e2e/actual-output

diff --ignore-all-space --side-by-side --suppress-common-lines e2e/expected-output e2e/actual-output
diff --ignore-all-space e2e/expected-output e2e/actual-output

0 comments on commit 05dde06

Please sign in to comment.