Skip to content

Commit

Permalink
Merge pull request #70 from funktechno/f/tests
Browse files Browse the repository at this point in the history
F/tests
  • Loading branch information
lastlink authored Jul 19, 2024
2 parents 2f8030e + 3927044 commit 37996f9
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 1 deletion.
86 changes: 86 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: 'Unit Tests'
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
jobs:
Sqlite:
runs-on: ubuntu-latest
container: kanboard/tests:latest
steps:
- name: Checkout Kanboard repo
uses: actions/checkout@v2
with:
repository: kanboard/kanboard
- name: Checkout Plugin repo
uses: actions/checkout@v2
with:
path: plugins/Wiki
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Unit tests with Sqlite
run: ./vendor/bin/phpunit -c tests/units.sqlite.xml plugins/Wiki/Test/

Postgres:
runs-on: ubuntu-latest
container: kanboard/tests:latest
services:
postgres:
image: postgres:9.4
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout Kanboard repo
uses: actions/checkout@v2
with:
repository: kanboard/kanboard
- name: Checkout Plugin repo
uses: actions/checkout@v2
with:
path: plugins/Wiki
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Unit tests with Postgres
run: ./vendor/bin/phpunit -c tests/units.postgres.xml plugins/Wiki/Test/
env:
DB_HOSTNAME: postgres
DB_PORT: ${{ job.services.postgres.ports[5432] }}

MariaDB:
runs-on: ubuntu-latest
container: kanboard/tests:latest
services:
mariadb:
image: mariadb:latest
env:
MYSQL_ROOT_PASSWORD: secret
ports:
- 3306:3306
steps:
- name: Checkout Kanboard repo
uses: actions/checkout@v2
with:
repository: kanboard/kanboard
- name: Checkout Plugin repo
uses: actions/checkout@v2
with:
path: plugins/Wiki
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Unit tests with MariaDB
run: ./vendor/bin/phpunit -c tests/units.mysql.xml plugins/Wiki/Test/
env:
DB_HOSTNAME: mariadb
DB_PASSWORD: secret
DB_PORT: ${{ job.services.mariadb.ports[3306] }}
8 changes: 7 additions & 1 deletion Test/Model/WikiPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@

class WikiPageTest extends Base
{
public function setUp()
/**
* @var Plugin
*/
protected $plugin;

protected function setUp(): void
{
parent::setUp();
// $this->plugin = new Plugin($this->container);

$plugin = new Loader($this->container);
$plugin->scan();
Expand Down

0 comments on commit 37996f9

Please sign in to comment.