Fernando Alonso 7 роки тому
батько
коміт
ae1cd35b25

+ 4 - 1
behat/testScreenshot/gitHead.php

@@ -2,7 +2,7 @@
 
 date_default_timezone_set('America/Argentina/Buenos_Aires');
 require 'vendor/autoload.php';
-
+/*
 $s3 = new Aws\S3\S3Client([
         'version' => 'latest',
         'region'  => 'sa-east-1',
@@ -15,3 +15,6 @@ $s3 = new Aws\S3\S3Client([
 ]);
 
 $s3->deleteBucket(array('Bucket' => 'fakes3'));
+
+*/
+echo $hora."\n".$fecha . "\n";

+ 29 - 50
behat/testScreenshot/tests/acceptance/5minioUpdateCest.php

@@ -8,8 +8,6 @@ class minioUpdateCest
 	public function minioUpdate()
 	{
 
-
-
 $s3 = new Aws\S3\S3Client([
         'version' => 'latest',
         'region'  => 'sa-east-1',
@@ -21,20 +19,6 @@ $s3 = new Aws\S3\S3Client([
             ],
 ]);
 
-/* Send a PutObject request and get the result object.
-$insert = $s3->putObject([
-     'Bucket' => 'testbucket',
-     'Key'    => 'testFer',
-     'Body'   => 'Hello Fer!!'."\n"
-]);
-
-// Download the contents of the object.
-$retrive = $s3->getObject([
-     'Bucket' => 'testbucket',
-     'Key'    => 'testFer',
-     'SaveAs' => 'testkey_local'
-]);
-*/
 	$head = shell_exec('git rev-parse HEAD');
 	$head = substr($head,0,-1);
 	$directorioA = array('01_login/','02_base/','03_ftth/','04_map/');
@@ -65,44 +49,39 @@ $retrive = $s3->getObject([
 			echo "Directorio '" . $dir . "' actualizado. Commit: " . $head . "\n" ;			
 	}
 
-
-
 //descargar HEAD~1
 
-$s3 = new Aws\S3\S3Client([
-        'version' => 'latest',
-        'region'  => 'sa-east-1',
-        'endpoint' => 'https://s3.infra.flowdat.com/minio/login',
-        'use_path_style_endpoint' => true,
-        'credentials' => [
-                'key'    => 'iksop',
-                'secret' => '8htoiwn44g204th',
-            ],
-]);
-	$head = shell_exec('git rev-parse HEAD~1');
-	$head = substr($head,0,-1);
+		$s3 = new Aws\S3\S3Client([
+        		'version' => 'latest',
+        		'region'  => 'sa-east-1',
+       			'endpoint' => 'https://s3.infra.flowdat.com/minio/login',
+        		'use_path_style_endpoint' => true,
+        		'credentials' => [
+                		'key'    => 'iksop',
+                		'secret' => '8htoiwn44g204th',
+            			],
+			]);
+	
+		$head = shell_exec('git rev-parse HEAD~1');
+		$head = substr($head,0,-1);
 
-	for ($i = 0; $i < 4; $i++)
-	{
-		$dir = $directorioA[$i];
-		shell_exec('mkdir -p ./tests/to_compare/' . $head . "/" . $dir);
-	}
+		for ($i = 0; $i < 4; $i++)
+		{
+			$dir = $directorioA[$i];
+			shell_exec('mkdir -p ./tests/to_compare/' . $head . "/" . $dir);
+		}
 
-	$iterator = $s3->getIterator('ListObjects', array('Bucket'=> "testbucket",'Prefix'=> $head));
+		$iterator = $s3->getIterator('ListObjects', array('Bucket'=> "testbucket",'Prefix'=> $head));
 
-	foreach ($iterator as $object) {
-//	    echo "Objeto cargado: " . $object['Key'];
-		
-		$retrive = $s3->getObject([
-     		'Bucket' => 'testbucket',
-     		'Key'    => $object['Key'],
-     		'SaveAs' => './tests/to_compare/' . $object['Key']
-]);
-		echo "Se descargó el archivo " . $object['Key'] . "\n";
-		}
-	
+		foreach ($iterator as $object) 
+		{
+//		    echo $object['Key'];
+			$retrive = $s3->getObject([
+     			'Bucket' => 'testbucket',
+     			'Key'    => $object['Key'],
+     			'SaveAs' => './tests/to_compare/' . $object['Key']
+				]);
+			echo "Se descargó el archivo " . $object['Key'] . "\n";
+		}	
 	}
 }
-
-// Print the body of the result by indexing into the result object.
-//echo $retrive['Body'];

+ 11 - 8
behat/testScreenshot/tests/acceptance/6compareCest.php

@@ -4,6 +4,9 @@ class compareCest
 	public function compare()
 	{
 
+$hora = date("h:i");
+$fecha = date("Y-n-j");
+
 	$head = shell_exec('git rev-parse HEAD');
 	$head = substr($head,0,-1);
 
@@ -14,8 +17,8 @@ class compareCest
 		for ($i = 0; $i < 4; $i++)
 		{
 			$directorio = $directorioA[$i];
-			shell_exec('mkdir -p ./tests/comp/' . $directorio);
-			$dir = opendir("tests/_output/debug/".$head."/".$directorio);
+			shell_exec('mkdir -p ./tests/comp/' . $fecha . "_" . $hora . "_" . $head . "/" . $directorio);
+			$dir = opendir("tests/_output/debug/" . $head . "/" . $directorio);
 			while ($archivo = readdir($dir))
 			{
 				if (is_dir($archivo))
@@ -23,7 +26,7 @@ class compareCest
 				}
 				else
 				{
-					shell_exec('compare tests/_output/debug/'.$head."/". $directorio . $archivo . ' tests/to_compare/'.$head1."/". $directorio . $archivo . ' tests/comp/'. $directorio .'comp'. $archivo . "\n");
+					shell_exec('compare tests/_output/debug/'.$head."/". $directorio . $archivo . ' tests/to_compare/'.$head1."/". $directorio . $archivo . ' tests/comp/' . $fecha . "_" . $hora . "_" . $head . "/" . $directorio .'comp'. $archivo . "\n");
 				}
 			}
 		}
@@ -48,7 +51,7 @@ $s3 = new Aws\S3\S3Client([
 	for ($i = 0; $i < 4; $i++)
 	{
 		$dir = $directorioA[$i];
-		$directorio = opendir("./tests/comp/" . $dir);
+		$directorio = opendir("./tests/comp/". $fecha . "_" . $hora . "_" . $head . "/" . $dir);
 		while ($archivo = readdir($directorio))
 		{
 			if (is_dir($archivo))
@@ -58,18 +61,18 @@ $s3 = new Aws\S3\S3Client([
 			{
 				$result = $s3->putObject(array(
 			    'Bucket'     => 'comparaciones',
-			    'Key'        => $head.'/'.$dir . $archivo,
-			    'SourceFile' => './tests/comp/' . $dir . $archivo    
+			    'Key'        => $fecha . "_" . $hora . "_" . $head . '/' . $dir . $archivo,
+			    'SourceFile' => './tests/comp/' . $fecha . "_" . $hora . "_" . $head . "/" . $dir . $archivo    
 				));
 
 // We can poll the object until it is accessible
 				$s3->waitUntil('ObjectExists', array(
 			    'Bucket' => 'comparaciones',
-			    'Key'    => $head.'/'.$dir . $archivo
+			    'Key'    => $fecha . "_" . $hora . "_" . $head . '/' . $dir . $archivo
 				));
 			}
 		}
-			echo "Directorio de comparación '" . $dir . "' actualizado. Commit: " . $head . "\n" ;			
+			echo "Directorio de comparación '" . $dir . "' actualizado. Fecha: " . $fecha . "_" . $hora . " Commit: " . $head . "\n" ;			
 	}
 
 	}