Comments (5)
We don't use an existing database for code coverage reports. Are you importing your database by hand before? See this line that triggers a clean site install (just so we have a database to run kernel tests against): https://github.com/Lullabot/drupal8ci/blob/master/dist/circleci/.circleci/RoboFile.php#L50
from drupal9ci.
@deviantintegral thanks for the reply, and sorry for taking a while to get back.
I'm not importing a DB by hand, I just have CircleCI watching a github repo and running on a Pull request. The Drupal project does have DB connection details in settings.php
$databases['default']['default'] = array (
'database' => 'foo',
'username' => 'bar',
'password' => 'baz',
'prefix' => '',
'host' => 'mariadb',
'port' => '3306',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
'driver' => 'mysql',
);
If this is causing the issue do I need to use a local.settings.php
somehow?
from drupal9ci.
By looking at https://github.com/Lullabot/drupal8ci/blob/master/dist/circleci/.circleci/RoboFile.php#L39 it seems that coverage reports do use a database (this might be for kernel tests).
Here is the line that is throwing the error:
This does not make much sense because we intentionally copy a settings.local.php which contains the database credentials so drush can run drush site:install
without requiring a connection string. I don't understand how the execution flow is ending up here.
@stuartabrown can you post here all or part of your circleci file and any other changes you have made?
from drupal9ci.
thanks @juampynr.
In .circleci directory i have the below:
the content of config.yml
is below:
# CircleCI integration with Drupal 8.
# Reusable steps.
## Copies .circle/Robofile to the repository root.
copy_robo: ©_robo
run:
name: Copy RoboFile.php
command: cp .circleci/RoboFile.php .
## Defines images and working directory.
defaults: &defaults
docker:
- image: juampynr/drupal8ci:latest
- image: selenium/standalone-chrome-debug:3.7.1-beryllium
- image: mariadb:10.3
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 1
working_directory: /var/www/html
## Defines the cache restoring mechanism.
restore_cache: &restore_cache
# We use the composer.lock as a way to determine if we can cache our build.
keys:
- v1-dependencies-{{ checksum "composer.lock" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
## Defines the cache saving mechanism.
save_cache: &save_cache
paths:
- ./vendor
key: v1-dependencies-{{ checksum "composer.lock" }}
#Jobs
## Job to run Unit and Kernel tests.
unit_kernel_tests: &unit_kernel_tests
<<: *defaults
steps:
- checkout
- *copy_robo
- restore_cache: *restore_cache
- run:
name: Run PHPUnit tests
command: robo job:run-unit-tests
- store_test_results:
path: /var/www/html/artifacts/phpunit
- store_artifacts:
path: /var/www/html/artifacts
- save_cache: *save_cache
## Job to run the update path and Behat tests.
behat_tests: &behat_tests
<<: *defaults
steps:
- checkout
- *copy_robo
- restore_cache: *restore_cache
- run:
name: Run Behat tests
command: robo job:run-behat-tests
- save_cache: *save_cache
- store_test_results:
path: /var/www/html/artifacts/behat
- store_artifacts:
path: /var/www/html/artifacts
## Job to check coding standards.
code_sniffer: &code_sniffer
<<: *defaults
steps:
- checkout
- *copy_robo
- restore_cache: *restore_cache
- run:
name: Inspect coding standards
command: robo job:check-coding-standards
- store_test_results:
path: /var/www/html/artifacts/phpcs
- store_artifacts:
path: /var/www/html/artifacts
- save_cache: *save_cache
## Job to check test coverage.
code_coverage: &code_coverage
<<: *defaults
steps:
- checkout
- *copy_robo
- restore_cache: *restore_cache
- run:
name: Generate code coverage report
command: robo job:generate-coverage-report
- store_artifacts:
path: /var/www/html/artifacts
- save_cache: *save_cache
# Declare all of the jobs we should run.
version: 2
jobs:
run-unit-kernel-tests:
<<: *unit_kernel_tests
run-behat-tests:
<<: *behat_tests
run-code-sniffer:
<<: *code_sniffer
run-code-coverage:
<<: *code_coverage
# Declare a workflow that runs all of our jobs in parallel.
workflows:
version: 2
test_and_lint:
jobs:
- run-unit-kernel-tests
- run-behat-tests
- run-code-sniffer
- run-code-coverage
from drupal9ci.
Hi @stuartabrown!
The above files look fine to me. At first sight I cannot spot any issues with them. Did you find out anything else? You could either run the job locally using the CircleCI CLI which you could debut or you could also re-run a failing job with SSH enabled (it's a dropdown at the top right corner when you view a job at CircleCI).
from drupal9ci.
Related Issues (20)
- Changes to upstream image causes CircleCI to break HOT 1
- Is this still supported? HOT 5
- Run Travis CI in a Drupal Docker project HOT 3
- Clarify instructions in scripts/databases HOT 8
- Cannot touch 'storage/testing.sqlite': No such file or directory HOT 1
- Errors saving and restoring cache HOT 8
- Drupal Test Traits configured for Github Actions config, but not other CI configs HOT 9
- Drupal 9 compatibility HOT 4
- Replace Behat tests by Cypress.io ones HOT 4
- Create Composer 2 version for both Dockerfile and Dockerfile9 HOT 6
- "Failed to connect to localhost port 80: Connection refused" HOT 1
- DocumentRoot directory doesn't exist HOT 12
- jq not available by default in drupal8ci:latest image
- Include intl extension for PHP
- Update underlying docker image or use third party one HOT 8
- Interactive command line interface HOT 2
- Remove CircleCI test
- Config validation in CI
- Rename project and references from drupal9ci to drupalci HOT 1
- How to install for Bitbucket HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drupal9ci.