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 0cfee4c commit 597eccf
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 110 deletions.
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
}
8 changes: 6 additions & 2 deletions .vortex/tests/test.workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@ case ${index} in
0)
bats "${TEST_DIR}"/bats/workflow.smoke.bats
bats "${TEST_DIR}"/bats/workflow.storage.curl.bats
bats "${TEST_DIR}"/bats/workflow.install.profile.bats
;;

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

2)
bats "${TEST_DIR}"/bats/workflow.utilities.bats
bats "${TEST_DIR}"/bats/workflow.install.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 +61,9 @@ case ${index} in

*)
bats "${TEST_DIR}"/bats/workflow.smoke.bats
bats "${TEST_DIR}"/bats/workflow.install.bats
bats "${TEST_DIR}"/bats/workflow.install.webroot.bats
bats "${TEST_DIR}"/bats/workflow.install.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 597eccf

@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.