Skip to content

Commit

Permalink
Rebalanced tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Dec 11, 2024
1 parent 60d8976 commit 6afac5d
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 111 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/vortex-test-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
strategy:
fail-fast: false
matrix:
batch: [0, 1, 2]
batch: [0, 1, 2, 3]

container:
image: drevops/ci-runner:24.11.0
Expand Down
108 changes: 0 additions & 108 deletions .vortex/tests/bats/workflow.install.bats

This file was deleted.

40 changes: 40 additions & 0 deletions .vortex/tests/bats/workflow.install.db.rootweb.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bats
#
# Workflows using different types of install source.
#

# shellcheck disable=SC2030,SC2031,SC2129

load _helper.bash
load _helper.workflow.bash

@test "Workflow: DB-driven, custom webroot" {
prepare_sut "Starting DB-driven WORKFLOW with custom webroot tests in build directory ${BUILD_DIR}" "rootdoc"

assert_ahoy_download_db

assert_ahoy_build "rootdoc"
assert_gitignore "" "rootdoc"

assert_ahoy_cli

assert_env_changes

assert_ahoy_drush

assert_ahoy_info "rootdoc"

assert_ahoy_export_db

assert_ahoy_lint "rootdoc"

assert_ahoy_test "rootdoc" "1"

assert_ahoy_fei "rootdoc"

assert_ahoy_fe "rootdoc"

assert_ahoy_reset "rootdoc"

assert_ahoy_reset_hard "rootdoc"
}
56 changes: 56 additions & 0 deletions .vortex/tests/bats/workflow.install.db.webroot.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env bats
#
# Workflows using different types of install source.
#

# shellcheck disable=SC2030,SC2031,SC2129

load _helper.bash
load _helper.workflow.bash

@test "Workflow: DB-driven" {
prepare_sut "Starting DB-driven WORKFLOW tests in build directory ${BUILD_DIR}"

assert_ahoy_download_db

assert_ahoy_build
assert_gitignore

assert_solr

assert_ahoy_cli

assert_env_changes

assert_timezone

assert_ahoy_composer

assert_ahoy_drush

assert_ahoy_info

assert_ahoy_container_logs

assert_ahoy_login

assert_ahoy_export_db

assert_ahoy_lint

assert_ahoy_test

assert_ahoy_fei

assert_ahoy_fe

assert_ahoy_debug

# Run this test as a last one to make sure that there is no concurrency issues
# with enabled Redis.
assert_redis

assert_ahoy_reset

assert_ahoy_reset_hard
}
30 changes: 30 additions & 0 deletions .vortex/tests/bats/workflow.install.profile.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bats
#
# Workflows using different types of install source.
#

# shellcheck disable=SC2030,SC2031,SC2129

load _helper.bash
load _helper.workflow.bash

@test "Workflow: profile-driven" {
rm -f .data/db.sql
export VORTEX_INSTALL_DEMO_SKIP=1
assert_file_not_exists .data/db.sql

prepare_sut "Starting fresh install WORKFLOW tests in build directory ${BUILD_DIR}"
# Assert that the database was not downloaded because VORTEX_INSTALL_DEMO_SKIP was set.
assert_file_not_exists .data/db.sql

echo "VORTEX_PROVISION_USE_PROFILE=1" >>.env

assert_ahoy_build
assert_gitignore

assert_ahoy_lint

assert_ahoy_test "web" "1"

assert_ahoy_fe
}
11 changes: 9 additions & 2 deletions .vortex/tests/test.workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,16 @@ case ${index} in
;;

1)
bats "${TEST_DIR}"/bats/workflow.install.bats
bats "${TEST_DIR}"/bats/workflow.install.db.webroot.bats
;;

2)
bats "${TEST_DIR}"/bats/workflow.install.profile.bats
;;

3)
bats "${TEST_DIR}"/bats/workflow.utilities.bats
bats "${TEST_DIR}"/bats/workflow.install.db.rootweb.bats
# Disabled due to intermittent failures.
# @see https://github.com/drevops/vortex/issues/893
# bats "${TEST_DIR}"/bats/workflow.storage.image_cached.bats
Expand All @@ -59,7 +64,9 @@ case ${index} in

*)
bats "${TEST_DIR}"/bats/workflow.smoke.bats
bats "${TEST_DIR}"/bats/workflow.install.bats
bats "${TEST_DIR}"/bats/workflow.install.db.webroot.bats
bats "${TEST_DIR}"/bats/workflow.install.db.rootweb.bats
bats "${TEST_DIR}"/bats/workflow.install.profile.bats
bats "${TEST_DIR}"/bats/workflow.storage.image.bats
# Disabled due to intermittent failures.
# @see https://github.com/drevops/vortex/issues/893
Expand Down

1 comment on commit 6afac5d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.