Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
S
stats-facil
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
facil
stats-facil
Validations
562c7579
Valider
562c7579
rédigé
11 years ago
par
mattab
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Simplify test code
parent
235ab936
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
1
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
tests/PHPUnit/Integration/ArchiveCronTest.php
+5
-26
5 ajouts, 26 suppressions
tests/PHPUnit/Integration/ArchiveCronTest.php
avec
5 ajouts
et
26 suppressions
tests/PHPUnit/Integration/ArchiveCronTest.php
+
5
−
26
Voir le fichier @
562c7579
...
@@ -74,28 +74,15 @@ class Test_Piwik_Integration_ArchiveCronTest extends IntegrationTestCase
...
@@ -74,28 +74,15 @@ class Test_Piwik_Integration_ArchiveCronTest extends IntegrationTestCase
return
$results
;
return
$results
;
}
}
public
function
getArchivePhpCronOptionsToTest
()
{
return
array
(
array
(
'noOptions'
,
array
()),
// segment archiving makes calling the script more than once impractical. if all 4 are
// called, this test can take up to 13min to complete.
/*array('forceAllWebsites', array('--force-all-websites' => false)),
array('forceAllPeriods_lastDay', array('--force-all-periods' => '86400')),
array('forceAllPeriods_allTime', array('--force-all-periods' => false)),*/
);
}
/**
/**
* @dataProvider getArchivePhpCronOptionsToTest
* @group Integration
* @group Integration
*/
*/
public
function
testArchivePhpCron
(
$optionGroupName
,
$archivePhpOptions
)
public
function
testArchivePhpCron
()
{
{
self
::
deleteArchiveTables
();
self
::
deleteArchiveTables
();
$this
->
setLastRunArchiveOptions
();
$this
->
setLastRunArchiveOptions
();
$output
=
$this
->
runArchivePhpCron
(
$archivePhpOptions
);
$output
=
$this
->
runArchivePhpCron
();
foreach
(
$this
->
getApiForTesting
()
as
$testInfo
)
{
foreach
(
$this
->
getApiForTesting
()
as
$testInfo
)
{
...
@@ -104,7 +91,7 @@ class Test_Piwik_Integration_ArchiveCronTest extends IntegrationTestCase
...
@@ -104,7 +91,7 @@ class Test_Piwik_Integration_ArchiveCronTest extends IntegrationTestCase
if
(
!
isset
(
$params
[
'testSuffix'
]))
{
if
(
!
isset
(
$params
[
'testSuffix'
]))
{
$params
[
'testSuffix'
]
=
''
;
$params
[
'testSuffix'
]
=
''
;
}
}
$params
[
'testSuffix'
]
.
=
'_
'
.
$optionGroupName
;
$params
[
'testSuffix'
]
.
=
'_
noOptions'
;
$params
[
'disableArchiving'
]
=
true
;
$params
[
'disableArchiving'
]
=
true
;
$success
=
$this
->
runApiTests
(
$api
,
$params
);
$success
=
$this
->
runApiTests
(
$api
,
$params
);
...
@@ -133,21 +120,13 @@ class Test_Piwik_Integration_ArchiveCronTest extends IntegrationTestCase
...
@@ -133,21 +120,13 @@ class Test_Piwik_Integration_ArchiveCronTest extends IntegrationTestCase
}
}
}
}
private
function
runArchivePhpCron
(
$options
)
private
function
runArchivePhpCron
()
{
{
$archivePhpScript
=
PIWIK_INCLUDE_PATH
.
'/tests/PHPUnit/proxy/archive.php'
;
$archivePhpScript
=
PIWIK_INCLUDE_PATH
.
'/tests/PHPUnit/proxy/archive.php'
;
$urlToProxy
=
Fixture
::
getRootUrl
()
.
'tests/PHPUnit/proxy/index.php'
;
$urlToProxy
=
Fixture
::
getRootUrl
()
.
'tests/PHPUnit/proxy/index.php'
;
// create the command
// create the command
$cmd
=
"php
\"
$archivePhpScript
\"
--url=
\"
$urlToProxy
\"
"
;
$cmd
=
"php
\"
$archivePhpScript
\"
--url=
\"
$urlToProxy
\"
2>&1"
;
foreach
(
$options
as
$name
=>
$value
)
{
$cmd
.
=
$name
;
if
(
$value
!==
false
)
{
$cmd
.
=
'="'
.
$value
.
'"'
;
}
$cmd
.
=
' '
;
}
$cmd
.
=
'2>&1'
;
// run the command
// run the command
exec
(
$cmd
,
$output
,
$result
);
exec
(
$cmd
,
$output
,
$result
);
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter