Skip to content

Commit

Permalink
Rebranded Allure reports and adapted to Github Actions (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnocon authored Mar 17, 2022
1 parent 5bf850b commit e90a9c4
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion bin/.travis/prepare_multirepository_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ docker-compose exec -T --user www-data app sh -c "php bin/console doctrine:datab
docker-compose exec -T --user www-data app sh -c 'php bin/console cache:pool:clear ${CACHE_POOL:-cache.tagaware.filesystem}'

# Run setup
docker-compose exec -T --user www-data app sh -c "vendor/bin/ezbehat --mode=standard --profile=setup --suite=multirepository -c=behat_ibexa_oss.yaml"
docker-compose exec -T --user www-data app sh -c "vendor/bin/ibexabehat --mode=standard --profile=setup --suite=multirepository -c=behat_ibexa_oss.yaml"
docker-compose exec -T --user www-data app sh -c "composer run post-install-cmd"

# Reinstal database using the new repository
Expand Down
18 changes: 9 additions & 9 deletions bin/ezbehat → bin/ibexabehat
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# Examples of use:
#
# for the 1-thread, pure behat tests:
# bin/ezbehat --mode=standard --profile=repository-forms --tags=~@broken
# bin/ezbehat -m=standard -p=rest -s=fullXml -t=~@broken
# bin/ibexabehat --mode=standard --profile=repository-forms --tags=~@broken
# bin/ibexabehat -m=standard -p=rest -s=fullXml -t=~@broken
#
# for the multi-thread fastest tests:
# bin/ezbehat -m=parallel -p=regression -s=demoRegression
# bin/ezbehat --profile=adminui --suite=adminui
# bin/ibexabehat -m=parallel -p=regression -s=demoRegression
# bin/ibexabehat --profile=adminui --suite=adminui
#
# for getting features list for given profiles/suites:
# bin/ezbehat --mode=get-features --profile=repository-forms --tags=~@broken
# bin/ezbehat -m=get-features -p=regression -s=demoRegression
# bin/ibexabehat --mode=get-features --profile=repository-forms --tags=~@broken
# bin/ibexabehat -m=get-features -p=regression -s=demoRegression

PROFILE=''
SUITE=''
Expand All @@ -25,7 +25,7 @@ STRICT='--strict'
usage(){
echo -e "\
Usage:
\t ezbehat [OPTIONS...]
\t ibexabehat [OPTIONS...]
Options:
Expand All @@ -39,8 +39,8 @@ Options:

# Error message
error(){
echo "ezbehat: invalid option -- '$1'";
echo "Try 'ezbehat -h' for more information.";
echo "ibexabehat: invalid option -- '$1'";
echo "Try 'ibexabehat -h' for more information.";
exit 1;
}

Expand Down
26 changes: 13 additions & 13 deletions bin/ezreport → bin/ibexareport
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# Examples of use:
#
# Default use in Travis builds:
# bin/ezreport
# bin/ibexareport
#
# Specify non-default SSH key and tested bundle name (required to run script outside Travis runs)
# bin/ezreport -i=path/to/sshkey -r=BehatBundle
# bin/ibexareport -i=path/to/sshkey -r=BehatBundle
# Reports generated in this way will be hosted on the server in BehatBundle/manual/time_stamp directory

SSH_KEY_PATH='vendor/ezsystems/behatbundle/bin/.travis/rsa_allure'
Expand All @@ -16,7 +16,7 @@ HOST_NAME='allure.ez.no'
usage(){
echo -e "\
Usage:
\t ezreport [OPTIONS...]
\t ibexareport [OPTIONS...]
Options:
Expand All @@ -28,8 +28,8 @@ Options:

# Error message
error(){
echo "ezreport: invalid option -- '$1'";
echo "Try 'ezreport -h' for more information.";
echo "ibexareport: invalid option -- '$1'";
echo "Try 'ibexareport -h' for more information.";
exit 1;
}

Expand All @@ -38,7 +38,7 @@ cd ${ALLURE_BUILD_PATH}
TIMESTAMP=$(date "+h%H-m%M")
if [ -z $REPOSITORY_NAME ];
then
REPORT_NAME="$(echo $TRAVIS_REPO_SLUG | cut -d'/' -f 2).$TRAVIS_JOB_NUMBER";
REPORT_NAME="$(echo $GITHUB_REPOSITORY | cut -d'/' -f 2).$GITHUB_RUN_ID.$GITHUB_RUN_NUMBER";
else
DATESTAMP=$(date "+%Y-%m-%d")
REPORT_NAME="$REPOSITORY_NAME.manual.$DATESTAMP";
Expand All @@ -50,15 +50,15 @@ cd -
}

send_report_to_server(){
sftp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -i $SSH_KEY_PATH allure@$HOST_NAME:incoming/ <<< $"put ${ALLURE_BUILD_PATH}${ZIP_FILENAME_EX}" 1> /dev/null
sftp -o StrictHostKeyChecking=no -q -o ConnectTimeout=10 -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -i $SSH_KEY_PATH allure@$HOST_NAME:incoming/ <<< $"put ${ALLURE_BUILD_PATH}${ZIP_FILENAME_EX}" 1> /dev/null
if [ $? -ne 0 ];
then echo "Failure occured when uploading the report";
else
ADDRESS_PATH="$(echo $ZIP_FILENAME | sed 's/\./\//g')"
WEB_ADDRESS="http://$HOST_NAME/$ADDRESS_PATH"
echo "See the report on ${WEB_ADDRESS}"
if [ $? -ne 0 ]; then
exit 1
fi
ADDRESS_PATH="$(echo $ZIP_FILENAME | sed 's/\./\//g')"
WEB_ADDRESS="http://$HOST_NAME/$ADDRESS_PATH"
echo "$WEB_ADDRESS"
}
process_report(){
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"dev-master": "8.3.x-dev"
}
},
"bin": ["bin/ezbehat", "bin/ezreport"],
"bin": ["bin/ibexabehat", "bin/ibexareport"],
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true
Expand Down
14 changes: 7 additions & 7 deletions doc/running_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,18 @@ After the container is set up correctly you need to adjust the configuration of

### Running standard Behat tests

BehatBundle comes with a wrapper for the standard Behat runner: [ezbehat](../bin/ezbehat.sh) to make running tests in parallel easier.
BehatBundle comes with a wrapper for the standard Behat runner: [ibexabehat](../bin/ibexabehat.sh) to make running tests in parallel easier.

Use:
```
# standard Behat runner
bin/ezbehat --mode=standard --profile=profileName --tags=exampleTag
bin/ezbehat -m=standard -p=profileName -s=suiteName -t=exampleTag
bin/ibexabehat --mode=standard --profile=profileName --tags=exampleTag
bin/ibexabehat -m=standard -p=profileName -s=suiteName -t=exampleTag
```
```
# parallel Behat runner
bin/ezbehat -m=parallel -p=profileName -s=suiteName
bin/ezbehat --profile=profileName --suite=suiteName
bin/ibexabehat -m=parallel -p=profileName -s=suiteName
bin/ibexabehat --profile=profileName --suite=suiteName
```

Running Behat feature files in parallel (on the available number of CPUs) is the default option when mode is not specified. See the script documentation for more examples.
Expand All @@ -60,8 +60,8 @@ Running Behat feature files in parallel (on the available number of CPUs) is the
By convention profiles and suites are defined in the `behat_suites.yml` file in each bundle, if they exist. See [BehatBundle suites](../behat_suites.yml) and [AdminUI suites](https://github.com/ezsystems/ezplatform-admin-ui/blob/master/behat_suites.yml) for examples.

In order to run them, execute:
- `bin/ezbehat --profile=behat --suite=examples` (BehatBundle usage examples)
- `bin/ezbehat --profile=adminui --suite=adminui` (all AdminUI tests)
- `bin/ibexabehat --profile=behat --suite=examples` (BehatBundle usage examples)
- `bin/ibexabehat --profile=adminui --suite=adminui` (all AdminUI tests)

## Previewing browser tests

Expand Down

0 comments on commit e90a9c4

Please sign in to comment.