File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -336,6 +336,22 @@ public function cleanupScenario(AfterScenarioScope $scope)
336336 chdir ($ this ->ee_path );
337337 }
338338
339+ /**
340+ * @Then There should be :expected_running_containers containers with labels
341+ */
342+ public function thereShouldBeContainersWithLabel ($ expected_running_containers , PyStringNode $ pyStringNode )
343+ {
344+ $ labels = $ pyStringNode ->getStrings ();
345+ $ label_string = implode ($ labels , ' -f label= ' );
346+
347+ $ result = EE ::launch ( "docker ps -aqf label= $ label_string | wc -l " , false , true );
348+ $ running_containers = (int ) trim ($ result ->stdout );
349+
350+ if ($ expected_running_containers === $ running_containers ) {
351+ throw new Exception ("Expected $ expected_running_containers running containers. Found: $ running_containers " );
352+ }
353+ }
354+
339355 /**
340356 * @AfterFeature
341357 */
@@ -349,6 +365,7 @@ public static function cleanup(AfterFeatureScope $scope)
349365 'www.example1.test ' ,
350366 'example2.test ' ,
351367 'www.example3.test ' ,
368+ 'labels.test '
352369 ];
353370
354371 $ result = EE ::launch ( 'sudo bin/ee site list --format=text ' ,false , true );
Original file line number Diff line number Diff line change 1+ Feature : Container Labels
2+
3+
4+ Scenario : All easyengine containers are tagged
5+ Given I run "bin/ee site create labels.test"
6+ Then There should be 5 containers with labels
7+ """
8+ io.easyengine.site=labels.test
9+ """
You can’t perform that action at this time.
0 commit comments