From 2aad246c2466b50831c34d6e0635db64a1000a53 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Thu, 29 Aug 2024 15:31:36 +1200 Subject: [PATCH] DOC Update docs to reflect changes in CLI interaction --- docs/circleci-tutorial.md | 36 +++++++++++++++++----------------- docs/tutorial.md | 16 +++++++-------- src/Context/FixtureContext.php | 4 ++-- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/docs/circleci-tutorial.md b/docs/circleci-tutorial.md index 63ba9135..e3f8de89 100644 --- a/docs/circleci-tutorial.md +++ b/docs/circleci-tutorial.md @@ -1,16 +1,16 @@ #Setting up CircleCI and Behat -If you'd like to run SilverStripe Behat tests on CircleCI, this can be achieved (along with screenshot artifacts on +If you'd like to run SilverStripe Behat tests on CircleCI, this can be achieved (along with screenshot artifacts on error) reasonably easily. - -The below extract is a full `circle.yml` configuration file that gets the environment setup and running for Behat tests. + +The below extract is a full `circle.yml` configuration file that gets the environment setup and running for Behat tests. Please review it thoroughly as there are a few things you'll need to change for your individual project. Notably: * If you already have a behat.yml, you should ensure your local requirements are reflected as the following script will - overwrite the behat.yml file in order to ensure screenshot failures are stored in a CircleCI-appropriate directory, + overwrite the behat.yml file in order to ensure screenshot failures are stored in a CircleCI-appropriate directory, even if you don't store screenshots locally. - * There is one variable required below (`REPO-NAME`) that you need to fill out yourself depending on the name of your + * There is one variable required below (`REPO-NAME`) that you need to fill out yourself depending on the name of your repository (CircleCI will check out your code into a sub-directory of the user's homedir based on the repository name). - * This assumes your Behat fixtures are located under the mysite/ directory. If not, check the `test.override` section + * This assumes your Behat fixtures are located under the mysite/ directory. If not, check the `test.override` section below. ``` @@ -23,17 +23,17 @@ dependencies: - ~/.composer/cache pre: - # Enable xdebug - this is for code coverage and may not be necessary for you. Remove if you don't need it, it can + # Enable xdebug - this is for code coverage and may not be necessary for you. Remove if you don't need it, it can # drastically slow down tests - sed -i 's/^;//' ~/.phpenv/versions/$(phpenv global)/etc/conf.d/xdebug.ini - - # We found that some machines have outdated composer versions, so we self-update before running install just in case + + # We found that some machines have outdated composer versions, so we self-update before running install just in case - sudo composer self-update - composer install --prefer-source --no-interaction - + # Behat and SilverStripe often require a reasonably large amount of memory, tune to your specific needs - echo "memory_limit = 512M" > ~/.phpenv/versions/$(phpenv global)/etc/conf.d/memory.ini - + # Setup the _ss_environment.php file per https://docs.silverstripe.org/en/3.4/getting_started/environment_management - | cat << 'EOF' > _ss_environment.php @@ -43,7 +43,7 @@ dependencies: define('SS_DATABASE_USERNAME', 'ubuntu'); define('SS_DATABASE_PASSWORD', ''); define('SS_ENVIRONMENT_TYPE', 'dev'); - + global $_FILE_TO_URL_MAPPING; $_FILE_TO_URL_MAPPING['/home/ubuntu/REPO-NAME'] = 'http://localhost:8080/'; EOF @@ -69,7 +69,7 @@ dependencies: - a2enmod rewrite - sudo service apache2 restart - # Get Selenium setup - we currently do this everytime but ideally we could store in the cache_directories and only + # Get Selenium setup - we currently do this everytime but ideally we could store in the cache_directories and only # grab if it doesn't exist to save time - an exercise left to the reader! - wget http://selenium-release.storage.googleapis.com/2.52/selenium-server-standalone-2.52.0.jar - 'java -jar selenium-server-standalone-2.52.0.jar > /dev/null 2>&1': @@ -85,7 +85,7 @@ dependencies: # Create assets directory and add group perms - if [ ! -d assets ]; then mkdir assets && chmod 777 assets; fi - + # Setup behat.yml - you will need to merge your current behat.yml into this configuration - | cat > behat.yml <