Skip to content

Commit

Permalink
feat: single full.bats test and GHA matrix strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
hanoii committed Oct 8, 2024
1 parent c0a8cc6 commit 45986cf
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 42 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
strategy:
matrix:
ddev_version: [stable, HEAD]
drupal_version: ["default", "10", "11"]
fail-fast: false

runs-on: ubuntu-latest
Expand All @@ -40,3 +41,4 @@ jobs:
debug_enabled: ${{ github.event.inputs.debug_enabled }}
addon_repository: ${{ env.GITHUB_REPOSITORY }}
addon_ref: ${{ env.GITHUB_REF }}
test_command: TEST_DRUPAL_CORE=${{ matrix.drupal_version }} bats tests
7 changes: 7 additions & 0 deletions tests/default-no-composer-json.bats
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
setup_file() {
if [ -z "$TEST_DRUPAL_CORE" ]; then
echo "TEST_DRUPAL_CORE is necessary to run tests" >&2
exit 1
fi
if [ "$TEST_DRUPAL_CORE" != "default" ]; then
skip "TEST_DRUPAL_CORE=$TEST_DRUPAL_CORE not handled by this test suite" >&2
fi
load '_common.bash'
_common_setup
}
Expand Down
41 changes: 0 additions & 41 deletions tests/full-d11.bats

This file was deleted.

11 changes: 10 additions & 1 deletion tests/full-d10.bats → tests/full.bats
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
setup_file() {
export TEST_DRUPAL_CORE=10
if [ -z "$TEST_DRUPAL_CORE" ]; then
echo "TEST_DRUPAL_CORE is necessary to run tests" >&2
exit 1
fi
if [ "$TEST_DRUPAL_CORE" != "10" ] && [ "$TEST_DRUPAL_CORE" != "11" ]; then
skip "TEST_DRUPAL_CORE=$TEST_DRUPAL_CORE not handled by this test suite" >&2
fi
load '_common.bash'
_common_setup
ddev config --php-version=8.2
if [ "$TEST_DRUPAL_CORE" = "11" ]; then
ddev config --php-version=8.3 --corepack-enable
fi
}

teardown_file() {
Expand Down

0 comments on commit 45986cf

Please sign in to comment.