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

Run campaigns tests after an upgrade of PrestaShop #37

Closed
wants to merge 59 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
65fcf69
Add workflow to test autoupgrade
jolelievre Jun 21, 2023
cf0c029
Trigger workflow on push
jolelievre Jun 21, 2023
0acf4ca
Add workflow_call
jolelievre Jun 21, 2023
d7a727f
Add workflow call
jolelievre Jun 21, 2023
f4cc3b8
Add types
jolelievre Jun 21, 2023
87113a6
Ubuntu latest
jolelievre Jun 21, 2023
c7eb68e
Fix docker build
jolelievre Jun 21, 2023
d2b0238
Fix set output
jolelievre Jun 21, 2023
5f9be17
Fix docker build
jolelievre Jun 21, 2023
b9ddcf9
Fix version fetch
jolelievre Jun 21, 2023
8011b99
Fix script path
jolelievre Jun 21, 2023
8813b71
Checkout for the script
jolelievre Jun 21, 2023
3a60ba0
Debug nightly version and docker version
jolelievre Jun 21, 2023
683947f
Debug target branch
jolelievre Jun 21, 2023
ee32175
Remove custom container name
jolelievre Jun 21, 2023
2c74b90
DEbug comment
jolelievre Jun 21, 2023
c8649e6
Still fixing versions
jolelievre Jun 21, 2023
3e8b5a7
Add inputs
jolelievre Jun 21, 2023
2d2965e
Remove inputs
jolelievre Jun 21, 2023
ae08566
Fiw wokflow call inputs
jolelievre Jun 21, 2023
62fc2bd
Final inputs for nightly, add specific container name
jolelievre Jun 21, 2023
942e70b
Fix module upgrade install
jolelievre Jun 21, 2023
59b40a2
Fix composer install for module
jolelievre Jun 21, 2023
d4ddf24
Fix composer
jolelievre Jun 21, 2023
32e1ef6
Fix autoupgrade checkout
jolelievre Jun 21, 2023
c767f70
Add admin dir
jolelievre Jun 21, 2023
8208cf7
Avoid skipping upgrade
jolelievre Jun 21, 2023
75301d3
Replace UI tests with target branch tests
jolelievre Jun 21, 2023
488a3cd
Optimize checkout for tests and use correct URL in tests
jolelievre Jun 21, 2023
d89d0e1
Handle upgrade to branch repository
jolelievre Jun 21, 2023
b4d4f47
Test full workflow based on nighly builds
jolelievre Jun 21, 2023
506d5a8
Fix getting source details
jolelievre Jun 21, 2023
08f788f
Double unzip for source archive
jolelievre Jun 21, 2023
3d40e35
Create extraction folder
jolelievre Jun 21, 2023
36b980c
Fix source zip path
jolelievre Jun 21, 2023
cb05e67
Source cannot be used with nightly as it has no docker files
jolelievre Jun 21, 2023
ffcbeaf
Handle using tags in addition with branches
jolelievre Jun 21, 2023
e95b91c
Fix required
jolelievre Jun 21, 2023
9f7bee1
Force test with PHP 7.4 as get_magic_quotes_gpc seems not to exist in…
jolelievre Jun 21, 2023
b8d8869
Launch composer install in target folder
jolelievre Jun 21, 2023
8d3e5bb
Build assets as well
jolelievre Jun 21, 2023
63336ea
Build before upgrade
jolelievre Jun 21, 2023
1a089ca
Installer node earlier
jolelievre Jun 21, 2023
000e32f
Conditional fetch on noghtly versions
jolelievre Jun 21, 2023
bf5d53a
Prevent error in step name when nightly build is not used
jolelievre Jun 21, 2023
893af41
Add module ref selection
jolelievre Jun 22, 2023
3929a26
Add configuration to disable overrides and custom modules
jolelievre Jun 22, 2023
9427036
Clean comments, prevent fetchin the whole repositories all the time
jolelievre Jun 22, 2023
fac72ca
Add concurrency, and option to upload failed upgraded shops
jolelievre Jun 22, 2023
da5b962
Remove disabling parameter that seem to prevent upgrade
jolelievre Jun 22, 2023
9528321
Reduce the number of campaigns to run to reduce execution time while …
jolelievre Jun 22, 2023
ab436df
Deactivate overrides and modules update
jolelievre Jun 22, 2023
71dac1b
Only disable overrides
jolelievre Jun 22, 2023
79c5f76
Fix json config
jolelievre Jun 23, 2023
84415f1
Renable all campaigns
jolelievre Jun 23, 2023
4784dbe
Disable upload of shop on push workflow
jolelievre Jun 23, 2023
92ecda8
Remove push workflow for first merge of this new workflow
jolelievre Jun 27, 2023
5f2feb9
Change default values
jolelievre Jun 27, 2023
f4f29c3
Merge branch 'PrestaShop:main' into test-upgrade
jolelievre Sep 25, 2023
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
35 changes: 35 additions & 0 deletions .github/scripts/get_version_from_nightly.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

$nightlyVersion = [];
$nightlyEndpoint = "https://api-nightly.prestashop-project.org/reports";

$targetBranch = $argv[1];
$reports = json_decode(file_get_contents($nightlyEndpoint), true);
$currentDate = "";
$zipFiles = [];
foreach ($reports as $report) {
if ($report['version'] !== $targetBranch || null === $report['download']) {
continue;
}

$nightlyVersion = [
"version" => getVersionFromFilename($report['download']),
"zip" => $report['download'],
"xml" => $report['xml'],
];

break;
}

if (empty($nightlyVersion)) {
throw new \RuntimeException('Could not find version details for branch ' . $targetBranch);
}

function getVersionFromFilename($filename) {
$matches = [];
preg_match('/^.*prestashop_(.*)\.zip$/', $filename, $matches);

return $matches[1];
}

echo json_encode($nightlyVersion);
82 changes: 82 additions & 0 deletions .github/workflows/upgrade_test_manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Testing PrestaShop upgrade
on:
workflow_dispatch:
inputs:
upgrade_module_ref:
description: Use a branch or tag for the autoupgrade module
type: choice
required: true
options:
- 'dev'
- 'master'
- '1.7.8.x'

Choose a reason for hiding this comment

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

copy paste error i think

- 'v4.16.0'
- 'v4.15.0'
- 'v4.14.2'
default: 'dev'
source_ref:
type: choice
description: Use a source branch or tag to start the upgrade from
required: true
options:
- '8.1.x'
- '8.0.x'
- '1.7.8.x'
- '8.0.4'
- '1.7.8.9'
default: '8.0.x'
target_ref:
type: choice
description: Use a target branch or tag to upgrade to
required: true
options:
- 'develop'
- '8.1.x'
- '8.0.x'
- '8.0.4'
- '8.1.0'
default: '8.1.x'
use_nightly_build:
type: boolean
description: Use latest nightly matching the target branch, if not the branch is checkout from repository branch HEAD
default: false
target_version:
description: If you do not use the nightly release, you must specify the version of target branch (ex 1.7.8.9, 8.0.4)
type: string
require: false
php_version:
type: choice
description: PHP version
required: true
options:
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
default: '8.1'
node_version:
type: choice
description: Node version
required: true
options:
- '14'
- '16'
default: '14'
upload_shop_on_failure:
description: Upload upgraded shop as an artifact if tests failed
type: boolean
required: false
default: false

jobs:
manual_test_upgrade:
uses: ./.github/workflows/upgrade_test_workflow_call.yml
with:
source_ref: ${{ github.event.inputs.source_ref }}
target_ref: ${{ github.event.inputs.target_ref }}
use_nightly_build: ${{ github.event.inputs.use_nightly_build }}
target_version: ${{ github.event.inputs.target_version }}
php_version: ${{ github.event.inputs.php_version }}
node_version: ${{ github.event.inputs.node_version }}
upload_shop_on_failure: ${{ github.event.inputs.upload_shop_on_failure }}
Loading