Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.

Commit 58ae142

Browse files
committed
Added extended tests for sample data
1 parent 2bafb6b commit 58ae142

9 files changed

+102
-16
lines changed

Diff for: .travis.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ before_script:
2828
- cat ./scripts/host/k_rebuild_environment.sh
2929
- cat ./init_project.sh
3030
- cat ./etc/config.yaml.dist
31+
- cat ./etc/helm/values.yaml
32+
- cat ./tests/_files/*
33+
- cat ./scripts/host/get_path_to_php.sh
3134

3235
script:
3336
# Run DevBox tests
34-
- cd ./tests && sudo bash ./run-tests-on-travis.sh && cd ..
37+
- travis_wait 30 sudo bash ./tests/run-tests-on-travis.sh
3538

3639
after_script:
3740
- sudo kubectl describe pods

Diff for: etc/helm/values.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ global:
4343
volumeHostPath: /Users/user/Projects/magento2-kubernetes-for-developers
4444
persistence:
4545
nfs:
46-
enabled: true # NFS Status
47-
serverIp: 192.168.99.1
46+
enabled: true # This value is overridden via <devbox_project>/etc/config.yaml
47+
serverIp: 192.168.99.1 # This value is overridden via <devbox_project>/etc/config.yaml
4848

4949
resources: {}
5050
# Uncomment the following

Diff for: scripts/host/configure_ubuntu_travis.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ cd "${devbox_dir}"
66
sudo ./scripts/host/configure_nfs_exports.sh
77
cp ./tests/include/configuration.sh.dist ./tests/include/configuration.sh
88
sed -i "s|git@github.com:|https://github.com/|g" ./etc/config.yaml.dist
9+
sed -i "s|git@github.com:|https://github.com/|g" ./tests/_files/*
10+
sed -i "s|php_executable=\"php\"|php_executable=\"\$HOME/.phpenv/shims/php\"|g" ./scripts/host/get_path_to_php.sh
11+
# TODO: Make configurable and enable for specific tests
12+
# sed -i "s|git clone|git clone --depth 1 |g" ./init_project.sh
913
sed -i "s|minikube start --cpus=2 --memory=4096|sudo minikube start --cpus=2 --memory=4096 --vm-driver=none --bootstrapper=kubeadm --kubernetes-version=v1.13.0|g" ./init_project.sh
10-
sed -i "s|git clone|git clone --depth 1 |g" ./init_project.sh
1114
sed -i "s|&& eval \$(minikube docker-env) ||g" ./scripts/host/k_rebuild_environment.sh
1215
sed -i "s/use_nfs:\ 1/use_nfs:\ 0/g" ./etc/config.yaml.dist
13-
sed -i "s/enabled:\ true \# NFS Status/enabled:\ false \# NFS Status/g" ./etc/helm/values.yaml
1416
sed -i "s/nfs_server_ip:\ \"0\.0\.0\.0\"/nfs_server_ip:\ \"$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+')\"/g" ./etc/config.yaml.dist
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# [To apply changes: init_project.sh -fc] Possible values: git, composer
2+
checkout_source_from: "git"
3+
4+
composer_project:
5+
# Current section used only if 'checkout_source_from' is set to 'composer'
6+
7+
# [To apply changes: init_project.sh -fc]
8+
# Custom version can be provided by using '={version}' appended to repo name. E.g. name: "magento/project-community-edition=2.2.0". Otherwise, default version is used
9+
name: "magento/project-community-edition"
10+
# Make sure to specify valid keys for this repository in etc/composer/auth.json
11+
url: "https://repo.magento.com"
12+
13+
repository_url:
14+
# Current section used only if 'checkout_source_from' is set to 'git'
15+
16+
# [To apply changes: init_project.sh -fc]
17+
# git@github.com:magento/magento2ce.git OR custom one. Use '::' to specify a specific branch, e.g: git@github.com:magento/magento2.git::2.1
18+
ce: "git@github.com:magento/magento2.git::2.3"
19+
# git@github.com:magento/magento2ee.git OR custom one
20+
ee: ""
21+
# can be replaced with custom repository. Use '::' to specify a specific branch, e.g: git@github.com:magento/magento2-sample-data.git::2.1-develop
22+
ce_sample_data: "git@github.com:magento/magento2-sample-data.git::2.3"
23+
# git@github.com:magento/magento2-sample-data-ee.git OR custom one
24+
ee_sample_data: ""
25+
26+
guest:
27+
# [To apply changes: init_project.sh -f] NFS will be used for folder synchronization on *nix and OSX hosts by default.
28+
use_nfs: 0
29+
# [To apply changes: init_project.sh -f] The placeholder IP will be replaced with auto-detected value, unless modified manually before execution of "init_project.sh" script.
30+
nfs_server_ip: "0.0.0.0"
31+
# [To apply changes: devbox reload] Default is 2Gb, around 3Gb is necessary to run functional tests.
32+
memory: 2048
33+
# Recommended number of CPUs is 2
34+
cpus: 1
35+
ip_address: "192.168.10.2"
36+
forwarded_ssh_port: 3000
37+
38+
environment:
39+
# [To apply changes: devbox reload] Valid versions: 5.6, 7.0, 7.1, 7.2
40+
php_version: "7.0"
41+
composer_prefer_source: 0
42+
# [To apply changes: m-reinstall OR m-varnish enable/disable]
43+
use_varnish: 0
44+
# [To apply changes: m-reinstall] Possible values: mysql, elasticsearch
45+
search_engine: "mysql"
46+
47+
magento:
48+
# [To apply changes: m-switch-to-ce -f OR m-switch-to-ee -f]
49+
install_sample_data: 1
50+
# [To apply changes: m-switch-to-ce -f OR m-switch-to-ee -f] Generate customer (customer@example.com:123123qQ), category, simple product, configurable product after successful Magento installation
51+
generate_basic_data: 1
52+
# [To apply changes: init_project.sh -f]
53+
host_name: "magento2.devbox2"
54+
# [To apply changes: m-reinstall]
55+
admin_frontname: "admin"
56+
language: "en_US"
57+
timezone: "America/Chicago"
58+
currency: "USD"
59+
admin_user: "admin"
60+
admin_password: "123123q"
61+
# [Changes applied on m-clear-cache] Available options: developer, production, default
62+
mode: "developer"
63+
64+
debug:
65+
# [Changes applied on m-clear-cache] Enable template path and block name hints on storefront
66+
magento_storefront: 0
67+
# [Changes applied on m-clear-cache] Enable template path hints in the admin panel
68+
magento_admin: 0
69+
# [Changes applied immediately] Enable detailed output from all scripts provided by current devbox project
70+
devbox_project: 0

Diff for: tests/include/assertions.sh

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ function executeBasicCommonAssertions()
1212

1313
function executeExtendedCommonAssertions()
1414
{
15+
assertTestsConfigured
16+
assertDebugConfigurationWork
1517
# TODO: Implement functionality and uncomment assertions
1618
# assertPhpStormConfigured
1719

Diff for: tests/include/global_variables.sh

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ current_config_name=""
1111
current_codebase=""
1212
current_magento_base_url=""
1313

14+
export SHUNIT_COLOR="always"
15+
1416
# Colors for CLI output
1517
bold=$(tput bold)
1618
green=$(tput setaf 2)

Diff for: tests/run-tests-on-travis.sh

+4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
#!/bin/bash
22
set -e
33

4+
cd ./tests
5+
46
echo "# Running Basic test suite"
57
bash ./testsuite-basic.sh
68
if [[ "${TRAVIS_EVENT_TYPE}" = "cron" ]] || [[ "${RUN_EXTENDED_TEST_SUITE}" = "true" ]]; then
79
echo '# Running extended test suite'
810
bash ./testsuite-extended.sh
911
fi
12+
13+
cd ..

Diff for: tests/testsuite-basic.sh

-4
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,7 @@ function testNoCustomConfigBasicTest()
6060
executeBasicCommonAssertions
6161
assertMagentoEditionIsCE
6262
assertCeSampleDataNotInstalled
63-
assertTestsConfigured
64-
assertDebugConfigurationWork
6563
assertRedisCacheIsEnabled
66-
67-
# executeExtendedCommonAssertions
6864
}
6965

7066
## Call and Run all Tests

Diff for: tests/testsuite-extended.sh

+14-7
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,24 @@ See logs in ${logs_dir}"
5151

5252
## Tests
5353

54-
function testNoCustomConfigExtendedTest()
54+
function testCe23WithSampleDataMysqlSearchNoNfs()
5555
{
56-
current_config_name="no_custom_config"
57-
current_codebase="ce"
56+
current_config_name="ce23_with_sample_data_mysql_search_no_nfs"
57+
current_codebase="ce23_with_sample_data"
58+
5859
installEnvironment
59-
# assertVarnishDisabled
60+
61+
assertSourceCodeIsFromBranch "${devbox_dir}/magento" "2.3"
62+
assertSourceCodeIsFromBranch "${devbox_dir}/magento/magento2ce-sample-data" "2.3"
63+
6064
executeBasicCommonAssertions
65+
assertCeSampleDataInstalled
6166
assertMagentoEditionIsCE
62-
assertCeSampleDataNotInstalled
63-
assertTestsConfigured
64-
assertDebugConfigurationWork
67+
68+
assertElasticSearchDisabled
69+
assertSearchWorks
70+
assertElasticSearchEnablingWorks
71+
6572
assertRedisCacheIsEnabled
6673

6774
executeExtendedCommonAssertions

0 commit comments

Comments
 (0)