Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EMA-150 #65

Merged
merged 43 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
02f8347
EMA-150
tperencz Jun 11, 2024
f670162
Ema 145 security issues fix (#63)
szsanyi Jul 5, 2024
1f4594f
EMA-150 auto test trigger
szsanyi Jul 8, 2024
0113b4d
EMA-150 auto test memory optimizing
szsanyi Jul 11, 2024
3469cb2
Merge branch 'master' into EMA-150
szsanyi Jul 11, 2024
a5a4353
EMA-150 auto test memory optimizing
szsanyi Jul 12, 2024
9209851
EMA-150 auto test memory optimizing
szsanyi Jul 12, 2024
3ade4ba
EMA-150 auto test memory optimizing
szsanyi Jul 12, 2024
d4e7337
EMA-150 auto test memory optimizing
szsanyi Jul 12, 2024
dccf3d7
EMA-150 auto test memory optimizing
Jul 18, 2024
0a9e471
EMA-150 auto test memory optimizing
Jul 18, 2024
ccffa1f
EMA-150 auto test memory optimizing
Jul 19, 2024
f85ab64
EMA-150 auto test memory optimizing
Jul 19, 2024
27a091c
EMA-150 auto test memory optimizing
Jul 20, 2024
0ec55ed
EMA-150 auto test memory optimizing
Jul 20, 2024
2c96c10
EMA-150 auto test memory optimizing
Jul 20, 2024
7eda10c
EMA-150 auto test memory optimizing
Jul 20, 2024
13c1015
EMA-150 auto test memory optimizing
Jul 21, 2024
299fbaa
EMA-150 auto test memory optimizing
Jul 22, 2024
98efee2
EMA-150 auto test memory optimizing
Jul 23, 2024
9809de6
EMA-150 auto test memory optimizing
Jul 23, 2024
1d2d5bd
Update .dockerignore
itegration-it Jul 24, 2024
1e909a2
EMA-150 auto test memory optimizing
Jul 25, 2024
58e981d
EMA-150 auto test memory optimizing
Jul 26, 2024
dfa8388
EMA-150 auto test memory optimizing
Jul 26, 2024
61d4db4
EMA-150 auto test memory optimizing
Jul 26, 2024
50029d9
EMA-150 auto test memory optimizing
Jul 26, 2024
d17f3c5
EMA-150 auto test memory optimizing
Jul 28, 2024
b1443b3
EMA-150 auto test memory optimizing
Jul 28, 2024
4746fb3
EMA-150 auto test memory optimizing
Jul 28, 2024
68f1508
EMA-150 auto test memory optimizing
Jul 29, 2024
6e1c63f
EMA-150 auto test memory optimizing
Jul 29, 2024
da6bcec
EMA-150 auto test memory optimizing
Jul 29, 2024
bf12617
EMA-150 auto test memory optimizing
Jul 29, 2024
c6e7ac0
EMA-150 auto test memory optimizing
Jul 29, 2024
07e18be
EMA-150 auto test memory optimizing
Jul 29, 2024
aec5114
EMA-150 auto test memory optimizing
Jul 29, 2024
75524ca
EMA-150 auto test memory optimizing
Jul 29, 2024
3712947
EMA-150 auto test memory optimizing
Jul 29, 2024
b855637
EMA-150 auto test memory optimizing
Jul 29, 2024
03d55ff
EMA-150 auto test memory optimizing
Jul 29, 2024
fd29597
EMA-150 auto test memory optimizing
Jul 29, 2024
70cfcea
EMA-150 auto test memory optimizing
Jul 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 68 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,21 @@ jobs:
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Checkout code
shell: bash
run: |
sudo apt-get update
sudo apt-get install git -y
git clone --branch ${{ steps.extract_branch.outputs.branch }} https://github.com/emartech/magento2-extension.git

- name: Login to GitLab
uses: docker/login-action@v3
with:
registry: ${{ vars.REGISTRY_URL }}
username: ${{ secrets.GITLAB_USER }}
password: ${{ secrets.GITLAB_TOKEN }}

- name: Install system tools
shell: bash
run: |
Expand All @@ -47,24 +50,52 @@ jobs:
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-compose-plugin -y
sudo apt-get install docker-compose-plugin docker-buildx-plugin -y

- name: Build mage_node image
shell: bash
run: |
cd magento2-extension/dev
docker build -f testv2/tools/docker/Dockerfile-mage-node --build-arg NPM_TOKEN=$NPM_TOKEN -t "mage_node" .
retries=3
count=0
until [ $count -ge $retries ]
do
DOCKER_BUILDKIT=1 docker build -f testv2/tools/docker/Dockerfile-mage-node --build-arg NPM_TOKEN=$NPM_TOKEN -t "mage_node" . && break
count=$((count+1))
echo "Retrying build mage_node image ($count/$retries)..."
sleep 30
done
if [ $count -ge $retries ]; then
echo "mage_node image building failed after $retries attempts."
exit 1
fi
env:
NPM_TOKEN: ${{ secrets.GITLAB_TOKEN }}
- name: Run unittest

- name: Run unit test
shell: bash
run: |
cd magento2-extension
bash dev/testv2/tools/scripts/run-unit.sh
retries=3
count=0
until [ $count -ge $retries ]
do
bash dev/testv2/tools/scripts/run-unit.sh && break
count=$((count+1))
echo "Retrying unit tests ($count/$retries)..."
sleep 30
done
if [ $count -ge $retries ]; then
echo "unit tests failed after $retries attempts."
exit 1
fi
env:
VERSION: ${{ matrix.magento-versions }}
NPM_TOKEN: ${{ secrets.GITLAB_TOKEN }}

e2e-tests:
runs-on: github-actions-runner-emarsys
# needs: unit-tests
permissions:
contents: "read"
strategy:
Expand All @@ -78,18 +109,21 @@ jobs:
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Checkout code
shell: bash
run: |
sudo apt-get update
sudo apt-get install git -y
git clone --branch ${{ steps.extract_branch.outputs.branch }} https://github.com/emartech/magento2-extension.git

- name: Login to GitLab
uses: docker/login-action@v3
with:
registry: ${{ vars.REGISTRY_URL }}
username: ${{ secrets.GITLAB_USER }}
password: ${{ secrets.GITLAB_TOKEN }}

- name: Install system tools
shell: bash
run: |
Expand All @@ -103,19 +137,45 @@ jobs:
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-compose-plugin -y
sudo apt-get install docker-compose-plugin docker-buildx-plugin -y

- name: Build mage_node image
shell: bash
run: |
cd magento2-extension/dev
docker build -f testv2/tools/docker/Dockerfile-mage-node --build-arg NPM_TOKEN=$NPM_TOKEN -t "mage_node" .
retries=3
count=0
until [ $count -ge $retries ]
do
DOCKER_BUILDKIT=1 docker build -f testv2/tools/docker/Dockerfile-mage-node --build-arg NPM_TOKEN=$NPM_TOKEN -t "mage_node" . && break
count=$((count+1))
echo "Retrying build mage_node image ($count/$retries)..."
sleep 30
done
if [ $count -ge $retries ]; then
echo "mage_node image building failed after $retries attempts."
exit 1
fi
env:
NPM_TOKEN: ${{ secrets.GITLAB_TOKEN }}
- name: Run e2stest

- name: Run e2e test
shell: bash
run: |
cd magento2-extension
bash dev/testv2/tools/scripts/run-e2e.sh
retries=3
count=0
until [ $count -ge $retries ]
do
bash dev/testv2/tools/scripts/run-e2e.sh && break
count=$((count+1))
echo "Retrying e2e tests ($count/$retries)..."
sleep 30
done
if [ $count -ge $retries ]; then
echo "e2e tests failed after $retries attempts."
exit 1
fi
env:
VERSION: ${{ matrix.magento-versions }}
NPM_TOKEN: ${{ secrets.GITLAB_TOKEN }}
3 changes: 3 additions & 0 deletions Model/Api/OrdersApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Emartech\Emarsys\Api\Data\OrdersApiResponseInterfaceFactory;
use Emartech\Emarsys\Api\OrdersApiInterface;
use Magento\Framework\Webapi\Exception as WebApiException;
use Magento\Sales\Model\Order;
use Magento\Sales\Model\ResourceModel\Order\Collection as OrderCollection;
use Magento\Sales\Model\ResourceModel\Order\CollectionFactory as OrderCollectionFactory;

Expand Down Expand Up @@ -144,7 +145,9 @@ private function handleItems(): array
{
$returnArray = [];

/** @var Order $order */
foreach ($this->orderCollection as $order) {
$order->setStoreName(str_replace(PHP_EOL, ' ', $order->getStoreName()));
$returnArray[] = $order;
}

Expand Down
3 changes: 2 additions & 1 deletion dev/.dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
test/node_modules
test/node_modules
testv2/tools
3 changes: 3 additions & 0 deletions dev/testv2/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ module.exports = defineConfig({
requestTimeout: 120000,
defaultCommandTimeout: 120000,
pageLoadTimeout: 120000,
experimentalMemoryManagement: true,
experimentalModifyObstructiveThirdPartyCode: true,
modifyObstructiveCode: true,
blockHosts: ['*snippet.url.com', '*scarabresearch.com'],
env: {
snippetUrl: 'http://snippet.url.com/main.js'
Expand Down
Loading