Control panel for hosting, domains and more
Switch branches/tags
Nothing to show
Clone or download
SilverFire Merge pull request #5 from tafid/run_tests_locally
Added "Running test locaaly" doc
Latest commit 09e6c0b Nov 15, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs minor Nov 8, 2018
src/config csfixed May 24, 2018
tests inited empty tests May 24, 2018
.gitignore hideved Aug 27, 2018
.php_cs csfixed May 24, 2018
.scrutinizer.yml hideved Aug 27, 2018
.travis.yml csfixed May 24, 2018
CHANGELOG.md bump Mar 10, 2017
LICENSE csfixed May 24, 2018
README.md Update README.md Nov 15, 2018
chkipper.json bump Mar 10, 2017
composer.json csfixed May 24, 2018
hidev.yml Added Development guide Aug 27, 2018
history.md bump Mar 10, 2017
phpunit.xml.dist inited empty tests May 24, 2018

README.md

HiPanel

Control panel for hosting, domains and more.

Latest Stable Version Total Downloads Build Status Scrutinizer Code Coverage Scrutinizer Code Quality Dependency Status

Logo

This package is the template for creating HiPanel project for your needs.

HiPanel is splitted into many pluggable packages you can choose from:

Installation

Prerequisites

1. PHP 7.1. (ondrej)

2. Composer.

3. docker-compose.

4. HiDev.

Installation

1. git clone hipanel

2. Then, composer install in repository root.

3. Using .env.example as example, create an .env file, with following content:

ENV=dev
REAL_IP=127.0.0.1
HOSTS=local.hipanel.advancedhosters.com
API_HOSTS_LINE=hiapi.advancedhosters.com:88.208.34.69

where 88.208.34.69 is ip you get from ping hiapi.advancedhosters.com

4. Next, hidev deploy in repository root.

5. Then docker-compose up.

6. Using docker ps you could find out port number.

For example, in 0.0.0.0:32785 use 32785 number with your REAL_IP, it should look like 127.0.0.1:32785 in browser address bar.

You could make your port number permanent by editing docker-compose.yml file in ports: field.

For example:

...
    ports:
      - "0.0.0.0:1080:80"
...

where 127.0.0.1:1080 would be your entry point.

Error

If you couldn't access page by 127.0.0.1:32785 url, the problem might be with wrong ip address in API_HOSTS_LINE. You should then again ping hiapi.advancedhosters.com and change ip address in .env file. Then you need to docker-compose down; docker-compose up.

Development

[WIP] This guide is being developed.

Overview

Test frameworks we use and their purpose

// Codeception, PHPunit. Structure of tests

Running tests locally

In order to run tests, you need to have installed JDK 11+ to run Selenium, Selenium itself and ChromeDriver. Selenium is a Java software that provides an API for automated web pages testing by serfing real web pages with a real browser.

1. Download and install JDK for your platform.

2. For Debian-based OS (e.g. Ubuntu) run our script which downloads Selenium and ChromeDriver

cd tests/software
./download.sh

For other OS'es – find and download appropriate executables.

3. Run Selenium with ChromeDriver.

./run.sh

If you develop multiple projects, you can safely use single running instance of Selenium for all projects: recources will be shared gracefully.

4. Build tests to compile actors classes with appropriate modules. Read Codeception docs to understand how it works.

./vendor/bin/codecept build    

5. Run tests

  • All tests:
./vendor/bin/codecept run
  • Module-specific:
./vendor/bin/codecept run vendor/hiqdev/hipanel-module-finance/tests/acceptance

You can also add flags -v, -vv or -vvv for different levels of verbosity, or add debug flag -d to have even more detailed output. For example:

./vendor/bin/codecept run -d -vvv vendor/hiqdev/hipanel-module-finance/tests/acceptance

Running tests inside Docker

// How to?

Contributing

// How do we contribute? // Trunk based development // Merge requests // Reviews

Docker-based development env

// What to read about?

xDebug in Docker

// What to do in PHPStorm, browser, etc? // How to check that xDebug is enabled on PHP side? // Troubleshooting: // - debug session does not get started; // - debug can not locate files;

Contributing to Codeception tests

// How to run tests and enhance them? // Limiting tests execution scope to a single cest