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

Commit 35c1f53

Browse files
committed
Magento Commerce (EE) linking test
1 parent 58e3b14 commit 35c1f53

22 files changed

+349
-21
lines changed

.travis.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ jobs:
1111
include:
1212
- stage: "Basic Tests"
1313
script:
14-
- travis_wait 15 sudo bash ./tests/run-tests-on-travis.sh testNoCustomConfigBasicTest
14+
- cd tests && sudo bash ./NoCustomConfigBasicTest.sh
1515
- stage: "Extended Tests"
16-
script: travis_wait 30 sudo bash ./tests/run-tests-on-travis.sh testCe23WithSampleDataMysqlSearchNoNfs
17-
- script: travis_wait 20 sudo bash ./tests/run-tests-on-travis.sh testCeFromComposerNoNfs
16+
script: cd tests && sudo bash ./Ce23WithSampleDataMysqlSearchNoNfsTest.sh
17+
- script: cd tests && sudo bash ./CeFromComposerNoNfsTest.sh
18+
- script: cd tests && sudo bash ./EeLinkingTest.sh
1819

1920
env:
20-
global:
2121
- CHANGE_MINIKUBE_NONE_USER=true
2222

2323
install:
@@ -41,8 +41,9 @@ before_script:
4141
- cat ./init_project.sh
4242
- cat ./etc/config.yaml.dist
4343
- cat ./etc/helm/values.yaml
44-
- cat ./tests/_files/*
44+
# - cat ./tests/_files/* # TODO: Cannot cat because of directory, move configs to a separate directory
4545
- cat ./scripts/host/get_path_to_php.sh
46+
- while sleep 540; do echo "=====[ $SECONDS seconds still running ]====="; done &
4647

4748
after_script:
4849
- sudo kubectl describe pods
@@ -55,3 +56,4 @@ after_script:
5556
- sudo cat ./tests/tmp/test/current-test.log
5657
- sudo cat ./tests/tmp/test/magento2-devbox/log/*
5758
- sudo cat /etc/exports
59+
- kill %1

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Upon a successful installation, you'll see the location and URL of the newly-ins
154154
- ![](docs/images/linux-icon.png)![](docs/images/osx-icon.png) On Mac and \*nix hosts: the same as on host
155155
- MySQL DB host:
156156
- inside the container: `localhost`
157-
- remotely: `<ip-from-config-yaml>` with port `30306`. Related configuration can be found in values.yaml inside magento2-devbox/etc/helm
157+
- remotely: `<ip-from-config-yaml>`
158158
- MySQL DB name: `magento`, `magento_integration_tests`
159159
- MySQL DB user/password: `root:123123q`
160160

init_project.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,11 @@ cd "${devbox_dir}"
216216

217217
if [[ $(isMinikubeRunning) -eq 0 ]]; then
218218
status "Starting minikube"
219-
minikube start --cpus=2 --memory=4096
219+
minikube start -v=0 --cpus=2 --memory=4096
220220
minikube addons enable ingress
221221
minikube addons enable heapster
222222
# hanged in some cases todo
223-
# minikube start --cache-images --cpus=2 --memory=4096 2> >(logError) | {
223+
# minikube start -v=0 --cache-images --cpus=2 --memory=4096 2> >(logError) | {
224224
# while IFS= read -r line
225225
# do
226226
# filterDevboxOutput "${line}"

k-restart

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ if [[ $(isMinikubeRunning) -eq 1 || $(isMinikubeSaved) -eq 1 ]]; then
1212
fi
1313

1414
# TODO: Avoid duplication with init_project.sh
15-
minikube start --cpus=2 --memory=4096 2> >(logError)
15+
minikube start -v=0 --cpus=2 --memory=4096 2> >(logError)
1616

1717
info "$(regular)See details in $(bold)${devbox_dir}/log/${current_script_name}.log$(regular). For debug output set $(bold)debug:devbox_project$(regular) to $(bold)1$(regular) in $(bold)etc/config.yaml$(regular)"

k-start

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ resetNestingLevel
99

1010
if [[ ! $(isMinikubeRunning) -eq 1 ]]; then
1111
// TDOO: Eliminate duplication with k-restart
12-
minikube start --cpus=2 --memory=4096 2> >(logError)
12+
minikube start -v=0 --cpus=2 --memory=4096 2> >(logError)
1313
fi
1414

1515

scripts/host/configure_ubuntu_travis.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sed -i "s|git@github.com:|https://github.com/|g" ./tests/_files/*
1010
sed -i "s|php_executable=\"php\"|php_executable=\"\$HOME/.phpenv/shims/php\"|g" ./scripts/host/get_path_to_php.sh
1111
# TODO: Make configurable and enable for specific tests
1212
# sed -i "s|git clone|git clone --depth 1 |g" ./init_project.sh
13-
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
13+
sed -i "s|minikube start -v=0 --cpus=2 --memory=4096|sudo minikube start -v=0 --cpus=2 --memory=4096 --vm-driver=none --bootstrapper=kubeadm --kubernetes-version=v1.13.0|g" ./init_project.sh
1414
sed -i "s|&& eval \$(minikube docker-env) ||g" ./scripts/host/k_rebuild_environment.sh
1515
sed -i "s/use_nfs:\ 1/use_nfs:\ 0/g" ./etc/config.yaml.dist
1616
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
File renamed without changes.

tests/EeLinkingTest.sh

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#! /usr/bin/env bash
2+
3+
cd "$(dirname "${BASH_SOURCE[0]}")/.." && project_root_dir=$PWD
4+
5+
tests_dir="${project_root_dir}/tests"
6+
cd ${tests_dir}
7+
8+
## Includes
9+
source include/global_variables.sh
10+
source include/configuration.sh
11+
source include/helpers.sh
12+
source include/assertions.sh
13+
14+
original_devbox_dir="${devbox_dir}"
15+
source ./../scripts/functions.sh
16+
devbox_dir=${original_devbox_dir}
17+
cd ${tests_dir}
18+
19+
## Setup and tear down
20+
21+
function oneTimeSetUp
22+
{
23+
clearLogs
24+
}
25+
26+
function setUp()
27+
{
28+
debug_devbox_project=0
29+
skip_codebase_stash=0
30+
}
31+
32+
function tearDown()
33+
{
34+
assertNoErrorsInLogs
35+
36+
if [[ ${delete_test_project_on_tear_down} -eq 1 ]]; then
37+
stashLogs
38+
stashMagentoCodebase
39+
clearTestTmp
40+
fi
41+
42+
# TODO: change globally when https://github.com/paliarush/magento2-vagrant-for-developers/issues/58 is unblocked
43+
devbox_dir="${tests_dir}/tmp/test/magento2-devbox"
44+
}
45+
46+
function oneTimeTearDown()
47+
{
48+
echo "
49+
See logs in ${logs_dir}"
50+
}
51+
52+
## Tests
53+
54+
function testNoCustomConfigBasicTest()
55+
{
56+
current_config_name="no_custom_config"
57+
current_codebase="ee"
58+
installEnvironment
59+
# assertVarnishDisabled
60+
executeBasicCommonAssertions
61+
assertMagentoEditionIsCE
62+
assertCeSampleDataNotInstalled
63+
assertRedisCacheIsEnabled
64+
65+
emulateEeRepoCloning
66+
assertMagentoSwitchToEeWorks
67+
assertMagentoFrontendAccessible
68+
assertMagentoEditionIsEE
69+
70+
assertMagentoSwitchToCeWorks
71+
assertMagentoFrontendAccessible
72+
assertMagentoEditionIsCE
73+
}
74+
75+
## Call and Run all Tests
76+
source lib/shunit2/shunit2
File renamed without changes.

tests/_files/magento2ee/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
composer.lock
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This file is used by the DevBox to check if Magento Commerce modules are linked properly in git-based installation.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/**
3+
* Magento application product metadata
4+
*
5+
* Copyright © Magento, Inc. All rights reserved.
6+
* See COPYING.txt for license details.
7+
*/
8+
namespace Magento\Enterprise\Model;
9+
10+
use Magento\Framework\App\ProductMetadata as FrameworkProductMetadata;
11+
12+
class ProductMetadata extends FrameworkProductMetadata
13+
{
14+
const EDITION_NAME = 'Enterprise';
15+
16+
/**
17+
* Get Magento edition
18+
*
19+
* @return string
20+
*/
21+
public function getEdition()
22+
{
23+
return self::EDITION_NAME;
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "magento/module-enterprise",
3+
"description": "N/A",
4+
"autoload": {
5+
"files": [
6+
"registration.php"
7+
],
8+
"psr-4": {
9+
"Magento\\Enterprise\\": ""
10+
}
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
9+
<preference for="Magento\Framework\App\ProductMetadataInterface" type="Magento\Enterprise\Model\ProductMetadata"/>
10+
</config>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9+
<module name="Magento_Enterprise" >
10+
</module>
11+
</config>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
use \Magento\Framework\Component\ComponentRegistrar;
8+
9+
ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Enterprise', __DIR__);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
exclude.log

0 commit comments

Comments
 (0)