SlideShare a Scribd company logo
1 of 125
Download to read offline
Automate Behavior-driven Development
Yas Naoi
Chief Architect, Cloud
DOCOMO Innovatins, Inc.
Yas
2
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
Yas
3
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
• Chief Architect, Cloud
Yas
4
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
• Chief Architect, Cloud
• DOCOMO Innovations, Inc. (Palo Alto, CA)
• NTT DOCOMO Inc.
Yas
• Chief Architect, Cloud
• DOCOMO Innovations, Inc. (Palo Alto, CA)
• NTT DOCOMO Inc.
• Cloud, DevOps, Agile Software Development
• d.o: 17 years
5
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 6
Our Team
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 7
/ Cloud Team Members /
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 8
/ Cloud Team Members /
CA
Yas
Baldwin
Kumiko
Tatsuya
Hiroki
Tamaki
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 9
/ Cloud Team Members /
India
Sachin
CA
Yas
Baldwin
Kumiko
Tatsuya
Hiroki
Tamaki
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 10
/ Cloud Team Members /
Japan
Xiaohua
Takumaru
Masami
Ryo
Tomohiro
India
Sachin
CA
Yas
Baldwin
Kumiko
Tatsuya
Hiroki
Tamaki Shota
Makoto
11
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
Cloud Orchestrator
Search: drupal cloud orchestrator
12
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
Cloud Orchestrator
Search: drupal cloud orchestrator
Multi-cloud Support
──────────────
13
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
Cloud Orchestrator
Multi-cloud Support
──────────────
§ AWS
14
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
Cloud Orchestrator
Multi-cloud Support
──────────────
§ AWS
§ Kubernetes
15
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
Cloud Orchestrator
Multi-cloud Support
──────────────
§ AWS
§ Kubernetes
§ OpenStack
16
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
Cloud Orchestrator
Multi-cloud Support
──────────────
§ AWS
§ Kubernetes
§ OpenStack
§ VMware
17
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
Cloud Orchestrator
Multi-cloud Support
──────────────
§ AWS
§ Kubernetes
§ OpenStack
§ VMware
§ Terraform Cloud
18
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
Cloud Orchestrator
Agenda
19
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
Agenda
• Development Model
• What’s Behat for Behavior-driven Development (BDD)
• Templating for Behat Test Scenarios
• Automated Testing for BDD
20
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
Development Model
21
Software Development Lifecycle
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 22
Software Development Lifecycle
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 23
Coding
Integration Testing
Component Design
Function Design Unit Testing
System Requirements System Testing
Business Requirements Acceptance Testing
V-model [Boehm 79]
Software Development Lifecycle
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 24
Business Requirements
V-model [Boehm 79]
Software Development Lifecycle
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 25
System Requirements
Business Requirements
V-model [Boehm 79]
Software Development Lifecycle
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 26
Component Design
System Requirements
Business Requirements
V-model [Boehm 79]
Software Development Lifecycle
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 27
Component Design
Function Design
System Requirements
Business Requirements
V-model [Boehm 79]
Software Development Lifecycle
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 28
Coding
Component Design
Function Design
System Requirements
Business Requirements
V-model [Boehm 79]
Software Development Lifecycle
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 29
Coding
Component Design
Function Design Unit Testing
System Requirements
Business Requirements
V-model [Boehm 79]
Software Development Lifecycle
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 30
Coding
Integration Testing
Component Design
Function Design Unit Testing
System Requirements
Business Requirements
V-model [Boehm 79]
Software Development Lifecycle
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 31
Coding
Integration Testing
Component Design
Function Design Unit Testing
System Requirements System Testing
Business Requirements
V-model [Boehm 79]
Software Development Lifecycle
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 32
Coding
Integration Testing
Component Design
Function Design Unit Testing
System Requirements System Testing
Business Requirements Acceptance Testing
V-model [Boehm 79]
Software Development Lifecycle
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 33
Coding
Integration Testing
Component Design
Function Design Unit Testing
System Requirements System Testing
Business Requirements Acceptance Testing
V-model [Boehm 79]
Software Development Lifecycle
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 34
Coding
Integration Testing
Component Design
Function Design Unit Testing
System Requirements System Testing
Business Requirements Acceptance Testing
TDD
V-model [Boehm 79]
Software Development Lifecycle
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 35
Coding
Integration Testing
Component Design
Function Design Unit Testing
System Requirements System Testing
Business Requirements Acceptance Testing
TDD
BDD
V-model [Boehm 79]
Software Development Lifecycle
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 36
Coding
Integration Testing
Component Design
Function Design Unit Testing
System Requirements System Testing
Business Requirements Acceptance Testing
TDD
BDD
ATDD
V-model [Boehm 79]
Software Development Lifecycle
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 37
Coding
Integration Testing
Component Design
Function Design Unit Testing
System Requirements System Testing
Business Requirements Acceptance Testing
V-model [Boehm 79]
✔TDD
BDD
ATDD
PHPUnit (Drupal)
Software Development Lifecycle
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 38
Coding
Integration Testing
Component Design
Function Design Unit Testing
System Requirements System Testing
Business Requirements Acceptance Testing
V-model [Boehm 79]
✔TDD
✔BDD (ATDD)
PHPUnit (Drupal)
Behat+
Drupal
Extension
Behavior-driven Development
39
PHPUnit
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 40
/**
* Tests CRUD for K8s node.
*
* @throws Exception
*/
public function testNode(): void {
$cloud_context = $this->cloudContext;
$data = $this->createNodeTestFormData(self::K8S_NODE_REPEAT_COUNT);
$this->updateNodesMockData($data);
// Update k8s nodes.
$this->drupalGet("/clouds/k8s/$cloud_context/node/update");
$this->assertNoErrorMessage();
for ($i = 0; $i < self::K8S_NODE_REPEAT_COUNT; $i++) {
$this->assertSession()->pageTextContains($data[$i]['name']);
}
for ($i = 0, $num = 1; $i < self::K8S_NODE_REPEAT_COUNT; $i++, $num++) {
// Make sure the all node listing exists.
$this->drupalGet('/clouds/k8s/node');
$this->assertNoErrorMessage();
for ($j = 0; $j < $num; $j++) {
$this->assertSession()->pageTextContains($data[$j]['name']);
}
}
}
BDD Test Scenario Example by Behat
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 41
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
Behat Components
42
Behat + drupal-extension + Chrome Driver
2022 DOCOMO Innovations, Inc. All Rights Reserved. Confidential.
43
Application under Test
(AUT)
Test Framework
Behat + drupal-extension + Chrome Driver
2022 DOCOMO Innovations, Inc. All Rights Reserved. Confidential.
44
Test Framework
Behat + drupal-extension + Chrome Driver
2022 DOCOMO Innovations, Inc. All Rights Reserved. Confidential.
Test Framework
Features
in Gherkin
45
Behat + drupal-extension + Chrome Driver
2022 DOCOMO Innovations, Inc. All Rights Reserved. Confidential.
Test Framework
Features
in Gherkin
Drupal Ext.
Drush Ext.
API Driver
46
Behat + drupal-extension + Chrome Driver
2022 DOCOMO Innovations, Inc. All Rights Reserved. Confidential.
Test Framework
Features
in Gherkin
Drupal Ext.
Drush Ext.
API Driver
Mink Ext.
Chrome Ext.
WebDriver
47
Behat + drupal-extension + Chrome Driver
2022 DOCOMO Innovations, Inc. All Rights Reserved. Confidential.
Chrome
Driver
Test Framework
Features
in Gherkin
Drupal Ext.
Drush Ext.
API Driver
Mink Ext.
Chrome Ext.
WebDriver
WebDriver
Implementation
48
Behat + drupal-extension + Chrome Driver
2022 DOCOMO Innovations, Inc. All Rights Reserved. Confidential.
Chrome
Driver
Headless
Browser
Test Framework
Features
in Gherkin
Drupal Ext.
Drush Ext.
API Driver
Mink Ext.
Chrome Ext.
WebDriver
WebDriver
Implementation
<< Native API >>
49
Behat + drupal-extension + Chrome Driver
2022 DOCOMO Innovations, Inc. All Rights Reserved. Confidential.
Application under Test
(AUT)
Chrome
Driver
Headless
Browser
<< Native API >> << HTTP >>
Test Framework
Features
in Gherkin
Drupal Ext.
Drush Ext.
API Driver
Mink Ext.
Chrome Ext.
WebDriver
WebDriver
Implementation
50
Behat’s Friend: Gherkin
51
Behat (Gherkin)
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 52
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
Behat (Gherkin)
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 53
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
Behat (Gherkin)
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 54
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
Behat (Gherkin)
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 55
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
Behat (Gherkin)
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 56
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
Behat (Gherkin)
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 57
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
Behat (Gherkin)
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 58
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
Behat (Gherkin)
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 59
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
Behat (Gherkin)
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 60
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
Behat (Gherkin)
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 61
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
Behat (Gherkin)
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 62
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
Behat (Gherkin)
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 63
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
Behat (Gherkin)
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 64
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
Initial State / Condition
Behat (Gherkin)
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 65
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
Action Take Place
Behat (Gherkin)
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 66
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
Expected Result
Can I use parameters?
67
I want to use parameters in scenarios!
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 68
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
I want to use parameters in scenarios!
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 69
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
I want to use parameters in scenarios!
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 70
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
I want to use parameters in scenarios!
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 71
Feature: Login, Check the Clean State, and Logout
In order to list resources on the clean state
As a user
I need to have both Drupal and AWS IAM permissions
Scenario: Log in as "Anonymous user"
Given I am not logged in
When I visit "/clouds"
Then I should be on "/user/login"
And I should see the heading "Log in"
Scenario Outline: Access cloud service providers
Given I am logged in as a user with the <role> role
And I should not see the link "All" in the "nav_bar"
And I should <verb> "Add cloud service provider" in the "nav_bar"
When I go to "/clouds"
Then I should be on "/admin/structure/cloud_config/add"
And I should get a <code> HTTP response
And I should see the heading <heading>
Examples:
| role | verb | code | heading |
| "Authenticated user" | not see | 403 | "Access denied" |
| "Cloud administrator" | see | 200 | "Add cloud service provider" |
| "Administrator" | see | 200 | "Add cloud service provider" |
How it works by natural language?
72
The Tricks
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 73
/**
* Log in as the existing user
*
* @Given I am logged in as user :name
*/
public function iAmLoggedInAsUser($name): void {
$user = user_load_by_name($name);
$this->getSession()->visit(user_pass_reset_url($user) . '/login');
}
The Tricks
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 74
/**
* Log in as the existing user
*
* @Given I am logged in as user :name
*/
public function iAmLoggedInAsUser($name): void {
$user = user_load_by_name($name);
$this->getSession()->visit(user_pass_reset_url($user) . '/login');
}
Sentence
The Tricks
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 75
/**
* Log in as the existing user
*
* @Given I am logged in as user :name
*/
public function iAmLoggedInAsUser($name): void {
$user = user_load_by_name($name);
$this->getSession()->visit(user_pass_reset_url($user) . '/login');
}
Parameter
Variable
The Tricks
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 76
/**
* Check if the current page contains no messages of the specified selector.
*
* @Then /^I should see no (?P<selector>(?:success|error|warning)) message$/
*/
public function assertSelectorNotVisible($selector): void {
switch ($selector) {
case 'success':
$selector_id = 'success_message_selector';
break;
case 'error':
$selector_id = 'error_message_selector';
break;
case 'warning':
$selector_id = 'warning_message_selector';
break;
default:
throw new ExpectationException(sprintf("Message type is invalid: %s",
$selector), $this->getSession()->getDriver());
}
$this->assertNotVisible($selector_id);
}
Regular
Expression
But scenario outline is not enough!
77
I want to use parameters for everything!
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 78
Scenario Outline: Launch an EC2 instance
Given I am logged in as user "{{ user_name }}"
When I visit "/clouds/design/server_template/"
And I click <instance_name>{{ cloud_context }}
And I click "Launch"
And the url should match "/launch"
And I check the box "Automatically terminate instance"
And I press "Launch"
Then I should be on "/clouds/aws_cloud/{{ cloud_context }}/instance"
And I should see "pending" in the <instance_name> row
And I should see <instance_type> in the <instance_name> row
And I should see "{{ availability_zone }}" in the <instance_name> row
Examples:
| instance_name | instance_type |
| "{{ instance_name_1 }}" | "{{ instance_type_1 }}" |
| "{{ instance_name_2 }}" | "{{ instance_type_2 }}" |
I want to use parameters for everything!
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 79
Scenario Outline: Launch an EC2 instance
Given I am logged in as user "{{ user_name }}"
When I visit "/clouds/design/server_template/"
And I click <instance_name>{{ cloud_context }}
And I click "Launch"
And the url should match "/launch"
And I check the box "Automatically terminate instance"
And I press "Launch"
Then I should be on "/clouds/aws_cloud/{{ cloud_context }}/instance"
And I should see "pending" in the <instance_name> row
And I should see <instance_type> in the <instance_name> row
And I should see "{{ availability_zone }}" in the <instance_name> row
Examples:
| instance_name | instance_type |
| "{{ instance_name_1 }}" | "{{ instance_type_1 }}" |
| "{{ instance_name_2 }}" | "{{ instance_type_2 }}" |
Twig Template!
Get Parameterized
80
Get Parameterized
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 81
Get Parameterized
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 82
docker build
Get Parameterized
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 83
docker build
RUN composer require 
drupal/cloud 
drupal/drupal-extension
...
Get Parameterized
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 84
Packagist:
drupal/cloud_orchestrator
incl. drupal/cloud
Feature: ...
Scenario Outline: ...
Examples:
docker build
RUN composer require 
drupal/cloud 
drupal/drupal-extension
...
<< Download >>
Get Parameterized
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 85
docker run docomoinnovations/cloud_orchestrator
Packagist:
drupal/cloud_orchestrator
incl. drupal/cloud
Feature: ...
Scenario Outline: ...
Examples:
docker build
RUN composer require 
drupal/cloud 
drupal/drupal-extension
...
<< Download >>
<< docker run >>
Get Parameterized
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 86
docker run docomoinnovations/cloud_orchestrator
Run drush cloud:behat:preprocess
• Read a YAML file whih contains parameter mappings
• Replace {{...}} as an input variable
Packagist:
drupal/cloud_orchestrator
incl. drupal/cloud
Feature: ...
Scenario Outline: ...
Examples:
docker build
RUN composer require 
drupal/cloud 
drupal/drupal-extension
...
<< Download >>
<< docker run >>
Get Parameterized
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 87
docker run docomoinnovations/cloud_orchestrator
Run drush cloud:behat:preprocess
• Read a YAML file whih contains parameter mappings
• Replace {{...}} as an input variable
private_params.yml
e.g.
This is a placeholder:
Cloud Orchestrator
Packagist:
drupal/cloud_orchestrator
incl. drupal/cloud
Feature: ...
Scenario Outline: ...
Examples:
docker build
RUN composer require 
drupal/cloud 
drupal/drupal-extension
...
<< Read parameter files>>
<< Download >>
<< docker run >>
Get Parameterized
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 88
docker run docomoinnovations/cloud_orchestrator
Run drush cloud:behat:preprocess
• Read a YAML file whih contains parameter mappings
• Replace {{...}} as an input variable
Feature: ...
Scenario Outline: ...
...<This is a placeholder>...
Examples:
| This is a placeholder |
| {{This is a placeholder}} |
private_params.yml
e.g.
This is a placeholder:
Cloud Orchestrator
Packagist:
drupal/cloud_orchestrator
incl. drupal/cloud
Feature: ...
Scenario Outline: ...
Examples:
docker build
RUN composer require 
drupal/cloud 
drupal/drupal-extension
...
<< Read parameter files>>
<< Read Feature template files>>
<< Download >>
<< docker run >>
Get Parameterized
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 89
docker run docomoinnovations/cloud_orchestrator
Run drush cloud:behat:preprocess
• Read a YAML file whih contains parameter mappings
• Replace {{...}} as an input variable
Feature: ...
Scenario Outline: ...
...<This is a placeholder>...
Examples:
| This is a placeholder |
| {{This is a placeholder}} |
private_params.yml
e.g.
This is a placeholder:
Cloud Orchestrator
Feature: ...
Scenario Outline: ...
...<This is a placeholder>...
Examples:
| This is a placeholder |
| Cloud Orchestrator |
Packagist:
drupal/cloud_orchestrator
incl. drupal/cloud
Feature: ...
Scenario Outline: ...
Examples:
docker build
RUN composer require 
drupal/cloud 
drupal/drupal-extension
...
<< Read parameter files>>
<< Read Feature template files>>
<< Output actual feature files>>
<< Download >>
<< docker run >>
Get Parameterized
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 90
docker run docomoinnovations/cloud_orchestrator
Run drush cloud:behat:preprocess
• Read a YAML file whih contains parameter mappings
• Replace {{...}} as an input variable
Run behat command
run_behat.sh
Feature: ...
Scenario Outline: ...
...<This is a placeholder>...
Examples:
| This is a placeholder |
| {{This is a placeholder}} |
private_params.yml
e.g.
This is a placeholder:
Cloud Orchestrator
Feature: ...
Scenario Outline: ...
...<This is a placeholder>...
Examples:
| This is a placeholder |
| Cloud Orchestrator |
Packagist:
drupal/cloud_orchestrator
incl. drupal/cloud
Feature: ...
Scenario Outline: ...
Examples:
docker build
RUN composer require 
drupal/cloud 
drupal/drupal-extension
...
<< Read parameter files>>
<< Read Feature template files>>
<< Output actual feature files>>
<< Read feature files>>
<< Download >>
<< docker run >>
Get Parameterized
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 91
docker run docomoinnovations/cloud_orchestrator
Run drush cloud:behat:preprocess
• Read a YAML file whih contains parameter mappings
• Replace {{...}} as an input variable
Run behat command
run_behat.sh
Feature: ...
Scenario Outline: ...
...<This is a placeholder>...
Examples:
| This is a placeholder |
| {{This is a placeholder}} |
private_params.yml
e.g.
This is a placeholder:
Cloud Orchestrator
Feature: ...
Scenario Outline: ...
...<This is a placeholder>...
Examples:
| This is a placeholder |
| Cloud Orchestrator |
Execute BDD tests
and get Output
Packagist:
drupal/cloud_orchestrator
incl. drupal/cloud
Feature: ...
Scenario Outline: ...
Examples:
docker build
RUN composer require 
drupal/cloud 
drupal/drupal-extension
...
<< Process features >>
<< Read parameter files>>
<< Read Feature template files>>
<< Output actual feature files>>
<< Read feature files>>
<< docker run >>
<< Download >>
GitLab CI/CD Pipeline
92
We Test Our Code
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 93
We Want This One!
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 94
GitLab CI/CD Pipeline
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 95
GitLab CI/CD Pipeline
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 96
GitLab CI/CD Pipeline Architecture Basics
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 97
Developer
GitLab CI/CD Pipeline Architecture Basics
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 98
Developer
GitLab CI/CD Pipeline Architecture Basics
GitLab Master
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 99
GitLab Master GitLab Runner
Developer
GitLab CI/CD Pipeline Architecture Basics
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 100
GitLab Master
GitLab
Repository
Developer
GitLab CI/CD Pipeline Architecture Basics
GitLab Runner
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 101
GitLab Master
CI/CD
Pipeline
GitLab
Repository
Developer
GitLab CI/CD Pipeline Architecture Basics
GitLab Runner
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 102
GitLab Master GitLab Runner
CI/CD
Pipeline
GitLab
Repository
Developer
gitlab-runner 1
gitlab-runner 2
…
gitlab-runner N
GitLab CI/CD Pipeline Architecture Basics
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 103
GitLab Master GitLab Runner
GitLab
Container
Registry
CI/CD
Pipeline
GitLab
Repository
Developer
GitLab CI/CD Pipeline Architecture Basics
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 104
gitlab-runner 1
gitlab-runner 2
…
gitlab-runner N
GitLab Master GitLab Runner
CI/CD
Pipeline
GitLab
Repository
Developer
GitLab CI/CD Pipeline Architecture Basics
GitLab
Container
Registry
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 105
gitlab-runner 1
gitlab-runner 2
…
gitlab-runner N
GitLab Master GitLab Runner
CI/CD
Pipeline
GitLab
Repository
Developer
GitLab CI/CD Pipeline Architecture Basics
GitLab
Container
Registry
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 106
gitlab-runner 1
gitlab-runner 2
…
gitlab-runner N
GitLab Master GitLab Runner
CI/CD
Pipeline
GitLab
Repository
Developer
GitLab CI/CD Pipeline Architecture Basics
GitLab
Container
Registry
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 107
gitlab-runner 1
gitlab-runner 2
…
gitlab-runner N
GitLab Master GitLab Runner
CI/CD
Pipeline
GitLab
Repository
Developer
GitLab CI/CD Pipeline Architecture Basics
GitLab
Container
Registry
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 108
gitlab-runner 1
gitlab-runner 2
…
gitlab-runner N
EC2
Our GitLab CI/CD Pipeline Architecture
GitLab Master (SaaS)
CI/CD
Pipeline
GitLab
Repository
Developer
Slack
GitLab
Container Registry
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 109
gitlab-runner 1
gitlab-runner 2
gitlab-runner 3
gitlab-runner 4
Slack Integration
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 110
How we can build CI/CD pipeline?
111
.gitlab-ci.yml
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 112
stages:
- run_tests
- .post
variables:
UPDATE: 20220408a
WEB_ROOT: '/var/www/html/web'
CLOUD_HOME: "${WEB_ROOT}/modules/contrib/cloud"
BROWSER_OUTPUT: "${WEB_ROOT}/sites/simpletest/browser_output/"
IMAGE_TAG: 9.4.x-arm64
.preprocess_template: &preprocess_definition
image:
name: "${CI_REGISTRY_IMAGE}:${IMAGE_TAG}"
stage: run_tests
only:
- branches
# - merge_requests
before_script: |
whoami
sudo service apache2 start
sudo service memcached start
sudo mkdir -p "${WEB_ROOT}/simpletest/${CI_PIPELINE_ID}"
sudo mount -t tmpfs -o size=8G tmpfs "${WEB_ROOT}/simpletest/${CI_PIPELINE_ID}"
sudo chmod 777 -R "${WEB_ROOT}/simpletest"
rm -rf "${CLOUD_HOME}" && cp -ar "${PWD}" "${CLOUD_HOME}”
.artifacts_template: &postprocess_definition
after_script: |
mkdir -p "${BROWSER_OUTPUT}"
if [ -d "${BROWSER_OUTPUT}" ]; then cp -ar "${BROWSER_OUTPUT}" "${CI_PROJECT_DIR}/";
else mkdir -p "${BROWSER_OUTPUT}" && touch "${BROWSER_OUTPUT}/NO_ARTIFACTS.txt"; fi
php -v
drush status
...
.gitlab-ci.yml
• Describe the pipeline definition in one YAML file
• Put root (top) directory of your branch
• Get started
– https://docs.gitlab.com/ee/ci/quick_start/
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 113
Demo
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 114
• Behat
• GitLab CI/CD Pipeline
Lessons That We Learned
115
Our Custom Extension to drupal-extension
1. Logged in as the existing user without password
– Using drush user:login
2. Take a screenshot, which is very useful in troubleshooting
– Not only with Selenium + @javascript, but Chrome Extension or w/o
@javascript
3. Specifying a region with the row index of a table
– Especially when the same labels are used in multiple rows
4. Assert only the success message shows
– Namely, neither error or warning messages show
116
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
Our Custom Extension to drupal-extension
117
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
1. Logged in as the existing user without password
– Using drush user:login
2. Take a screenshot, which is very useful in troubleshooting
– Not only with Selenium + @javascript, but Chrome Extension
or w/o @javascript annotation
3. Specifying a region with the row index of a table
– Especially when the same labels are used in multiple rows
4. Assert only the success message shows
– Namely, neither error or warning messages show
1. Logged in as the existing user without password
– Using drush user:login
2. Take a screenshot, which is very useful in troubleshooting
– Not only with Selenium + @javascript, but Chrome Extension
or w/o @javascript annotation
3. Specifying a region with the row index of a table
– Especially when the same labels are used in multiple rows
4. Assert only the success message shows
– Namely, neither error or warning messages show
Our Custom Extension to drupal-extension
118
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
1. Logged in as the existing user without password
– Using drush user:login
2. Take a screenshot, which is very useful in troubleshooting
– Not only with Selenium + @javascript, but Chrome Extension
or w/o @javascript annotation
3. Specifying a region with the row index of a table
– Especially when the same labels are used in multiple rows
4. Assert only the success message shows
– Namely, neither error or warning messages show
Our Custom Extension to drupal-extension
119
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
Our Custom Extension to drupal-extension
120
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
1. Logged in as the existing user without password
– Using drush user:login
2. Take a screenshot, which is very useful in troubleshooting
– Not only with Selenium + @javascript, but Chrome Extension
or w/o @javascript annotation
3. Specifying a region with the row index of a table
– Especially when the same labels are used in multiple rows
4. Assert only the success message shows
– Namely, neither error or warning messages show
Known Issues: Solutions
1. User login sometimes fails due to "Username" is not found
– Workaround: add a longer sleep after chromium started
2. The text in checkbox/link is visible, but not ready to be clicked
– Add 500 ms sleep before such action
3. Cannot distinguish DOM objects if the same text are set
– For the table rows
4. Cannot login with a role created in the same Behat process
– Workaround: divide a feature file to run Behat for each
– Avoid using login with such role
121
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
Resources
122
Where to Find Our Solutions
123
• Behat feature files & configurations
– https://git.drupalcode.org/project/cloud/-/tree/5.x/tests/src/Behat
– https://git.drupalcode.org/project/cloud/-/tree/5.x/modules/cloud_service_providers/aws_cloud/tests/src/Behat
– https://git.drupalcode.org/project/cloud/-/tree/5.x/modules/cloud_service_providers/k8s/tests/src/Behat
• Drupal extensions with our custom functions
– https://github.com/docomoinnovations/drupalextension
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
Resources
124
• Cloud Orchestrator
– https://drupal.org/project/cloud
– https://cloud.airgap.host
• YouTube Channel
– https://bit.ly/2TJssME
Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
Coming together is a beginning,
keeping together is a progress;
working together is a success.
Henry Ford
“ “

More Related Content

What's hot

Using Vault to decouple MySQL Secrets
Using Vault to decouple MySQL SecretsUsing Vault to decouple MySQL Secrets
Using Vault to decouple MySQL SecretsDerek Downey
 
開発環境をVagrantからdockerに移行してみた
開発環境をVagrantからdockerに移行してみた開発環境をVagrantからdockerに移行してみた
開発環境をVagrantからdockerに移行してみたpyar6329
 
Oracle Cloud Infrastructure:2023年2月度サービス・アップデート
Oracle Cloud Infrastructure:2023年2月度サービス・アップデートOracle Cloud Infrastructure:2023年2月度サービス・アップデート
Oracle Cloud Infrastructure:2023年2月度サービス・アップデートオラクルエンジニア通信
 
IBM RedHat OCP Vs xKS.pptx
IBM RedHat OCP Vs xKS.pptxIBM RedHat OCP Vs xKS.pptx
IBM RedHat OCP Vs xKS.pptxssuser666667
 
Cloud Spanner をより便利にする運用支援ツールの紹介
Cloud Spanner をより便利にする運用支援ツールの紹介Cloud Spanner をより便利にする運用支援ツールの紹介
Cloud Spanner をより便利にする運用支援ツールの紹介gree_tech
 
Docker introduction (1)
Docker introduction (1)Docker introduction (1)
Docker introduction (1)Gourav Varma
 
Ingress on Azure Kubernetes Service
Ingress on Azure Kubernetes ServiceIngress on Azure Kubernetes Service
Ingress on Azure Kubernetes ServiceToru Makabe
 
Introduction to Virtualization, Virsh and Virt-Manager
Introduction to Virtualization, Virsh and Virt-ManagerIntroduction to Virtualization, Virsh and Virt-Manager
Introduction to Virtualization, Virsh and Virt-Managerwalkerchang
 
Qlik Replicate のインストール
Qlik Replicate のインストールQlik Replicate のインストール
Qlik Replicate のインストールQlikPresalesJapan
 
Autonomous を支える技術、Oracle Database 18c デモンストレーション
Autonomous を支える技術、Oracle Database 18c デモンストレーションAutonomous を支える技術、Oracle Database 18c デモンストレーション
Autonomous を支える技術、Oracle Database 18c デモンストレーションオラクルエンジニア通信
 
Docker Compose入門~今日から始めるComposeの初歩からswarm mode対応まで
Docker Compose入門~今日から始めるComposeの初歩からswarm mode対応までDocker Compose入門~今日から始めるComposeの初歩からswarm mode対応まで
Docker Compose入門~今日から始めるComposeの初歩からswarm mode対応までMasahito Zembutsu
 
これで怖くない!?大規模環境で体験するDB負荷対策~垂直から水平の彼方へ~
これで怖くない!?大規模環境で体験するDB負荷対策~垂直から水平の彼方へ~これで怖くない!?大規模環境で体験するDB負荷対策~垂直から水平の彼方へ~
これで怖くない!?大規模環境で体験するDB負荷対策~垂直から水平の彼方へ~hideakikabuto
 
Apache BigtopによるHadoopエコシステムのパッケージング(Open Source Conference 2021 Online/Osaka...
Apache BigtopによるHadoopエコシステムのパッケージング(Open Source Conference 2021 Online/Osaka...Apache BigtopによるHadoopエコシステムのパッケージング(Open Source Conference 2021 Online/Osaka...
Apache BigtopによるHadoopエコシステムのパッケージング(Open Source Conference 2021 Online/Osaka...NTT DATA Technology & Innovation
 
Kubernetesを使う上で抑えておくべきAWSの基礎概念
Kubernetesを使う上で抑えておくべきAWSの基礎概念Kubernetesを使う上で抑えておくべきAWSの基礎概念
Kubernetesを使う上で抑えておくべきAWSの基礎概念Shinya Mori (@mosuke5)
 
DRUPAL CI/CD FROM DEV TO PROD WITH GITLAB, KUBERNETES AND HELM
DRUPAL CI/CD FROM DEV TO PROD WITH GITLAB, KUBERNETES AND HELMDRUPAL CI/CD FROM DEV TO PROD WITH GITLAB, KUBERNETES AND HELM
DRUPAL CI/CD FROM DEV TO PROD WITH GITLAB, KUBERNETES AND HELMDrupalCamp Kyiv
 

What's hot (20)

Using Vault to decouple MySQL Secrets
Using Vault to decouple MySQL SecretsUsing Vault to decouple MySQL Secrets
Using Vault to decouple MySQL Secrets
 
開発環境をVagrantからdockerに移行してみた
開発環境をVagrantからdockerに移行してみた開発環境をVagrantからdockerに移行してみた
開発環境をVagrantからdockerに移行してみた
 
Oracle Cloud Infrastructure:2023年2月度サービス・アップデート
Oracle Cloud Infrastructure:2023年2月度サービス・アップデートOracle Cloud Infrastructure:2023年2月度サービス・アップデート
Oracle Cloud Infrastructure:2023年2月度サービス・アップデート
 
ssh-agentのすすめ
ssh-agentのすすめssh-agentのすすめ
ssh-agentのすすめ
 
IBM RedHat OCP Vs xKS.pptx
IBM RedHat OCP Vs xKS.pptxIBM RedHat OCP Vs xKS.pptx
IBM RedHat OCP Vs xKS.pptx
 
AWS CLIでAssumeRole
AWS CLIでAssumeRoleAWS CLIでAssumeRole
AWS CLIでAssumeRole
 
PowerShell-1
PowerShell-1PowerShell-1
PowerShell-1
 
Terraform
TerraformTerraform
Terraform
 
Cloud Spanner をより便利にする運用支援ツールの紹介
Cloud Spanner をより便利にする運用支援ツールの紹介Cloud Spanner をより便利にする運用支援ツールの紹介
Cloud Spanner をより便利にする運用支援ツールの紹介
 
Docker introduction (1)
Docker introduction (1)Docker introduction (1)
Docker introduction (1)
 
Ingress on Azure Kubernetes Service
Ingress on Azure Kubernetes ServiceIngress on Azure Kubernetes Service
Ingress on Azure Kubernetes Service
 
Introduction to Virtualization, Virsh and Virt-Manager
Introduction to Virtualization, Virsh and Virt-ManagerIntroduction to Virtualization, Virsh and Virt-Manager
Introduction to Virtualization, Virsh and Virt-Manager
 
Qlik Replicate のインストール
Qlik Replicate のインストールQlik Replicate のインストール
Qlik Replicate のインストール
 
Autonomous を支える技術、Oracle Database 18c デモンストレーション
Autonomous を支える技術、Oracle Database 18c デモンストレーションAutonomous を支える技術、Oracle Database 18c デモンストレーション
Autonomous を支える技術、Oracle Database 18c デモンストレーション
 
Docker Compose入門~今日から始めるComposeの初歩からswarm mode対応まで
Docker Compose入門~今日から始めるComposeの初歩からswarm mode対応までDocker Compose入門~今日から始めるComposeの初歩からswarm mode対応まで
Docker Compose入門~今日から始めるComposeの初歩からswarm mode対応まで
 
Introduction to helm
Introduction to helmIntroduction to helm
Introduction to helm
 
これで怖くない!?大規模環境で体験するDB負荷対策~垂直から水平の彼方へ~
これで怖くない!?大規模環境で体験するDB負荷対策~垂直から水平の彼方へ~これで怖くない!?大規模環境で体験するDB負荷対策~垂直から水平の彼方へ~
これで怖くない!?大規模環境で体験するDB負荷対策~垂直から水平の彼方へ~
 
Apache BigtopによるHadoopエコシステムのパッケージング(Open Source Conference 2021 Online/Osaka...
Apache BigtopによるHadoopエコシステムのパッケージング(Open Source Conference 2021 Online/Osaka...Apache BigtopによるHadoopエコシステムのパッケージング(Open Source Conference 2021 Online/Osaka...
Apache BigtopによるHadoopエコシステムのパッケージング(Open Source Conference 2021 Online/Osaka...
 
Kubernetesを使う上で抑えておくべきAWSの基礎概念
Kubernetesを使う上で抑えておくべきAWSの基礎概念Kubernetesを使う上で抑えておくべきAWSの基礎概念
Kubernetesを使う上で抑えておくべきAWSの基礎概念
 
DRUPAL CI/CD FROM DEV TO PROD WITH GITLAB, KUBERNETES AND HELM
DRUPAL CI/CD FROM DEV TO PROD WITH GITLAB, KUBERNETES AND HELMDRUPAL CI/CD FROM DEV TO PROD WITH GITLAB, KUBERNETES AND HELM
DRUPAL CI/CD FROM DEV TO PROD WITH GITLAB, KUBERNETES AND HELM
 

Similar to Automate Behavior-driven Development (DrupalCon Portland 2022)

Automate Behavior-driven Development (Stanford WebCamp 2022)
Automate Behavior-driven Development (Stanford WebCamp 2022)Automate Behavior-driven Development (Stanford WebCamp 2022)
Automate Behavior-driven Development (Stanford WebCamp 2022)DOCOMO Innovations, Inc.
 
Mainframe DevOps: A Zowe CLI-enabled Roadmap
Mainframe DevOps: A Zowe CLI-enabled RoadmapMainframe DevOps: A Zowe CLI-enabled Roadmap
Mainframe DevOps: A Zowe CLI-enabled RoadmapDevOps.com
 
Agile practice in drupal 8 module development 20200328a
Agile practice in drupal 8 module development 20200328aAgile practice in drupal 8 module development 20200328a
Agile practice in drupal 8 module development 20200328aDOCOMO Innovations, Inc.
 
A11yTC MeetUp: Role-based Analysis of WCAG 2.2
A11yTC MeetUp: Role-based Analysis of WCAG 2.2A11yTC MeetUp: Role-based Analysis of WCAG 2.2
A11yTC MeetUp: Role-based Analysis of WCAG 2.2Bill Tyler
 
DevOps for Mainframe: Open Source Fast Track
DevOps for Mainframe: Open Source Fast TrackDevOps for Mainframe: Open Source Fast Track
DevOps for Mainframe: Open Source Fast TrackDevOps.com
 
Optimize your CI/CD with GitLab and AWS
Optimize your CI/CD with GitLab and AWSOptimize your CI/CD with GitLab and AWS
Optimize your CI/CD with GitLab and AWSDevOps.com
 
CSUN 2022 Role-based analysis update: WCAG 2.2
CSUN 2022 Role-based analysis update: WCAG 2.2CSUN 2022 Role-based analysis update: WCAG 2.2
CSUN 2022 Role-based analysis update: WCAG 2.2Bill Tyler
 
Software Factory Tools Partner Day Final
Software Factory Tools Partner Day FinalSoftware Factory Tools Partner Day Final
Software Factory Tools Partner Day FinalLek Pongpatimet
 
CampDevOps keynote - DevOps: Using 'Lean' to eliminate Bottlenecks
CampDevOps keynote - DevOps: Using 'Lean' to eliminate BottlenecksCampDevOps keynote - DevOps: Using 'Lean' to eliminate Bottlenecks
CampDevOps keynote - DevOps: Using 'Lean' to eliminate BottlenecksSanjeev Sharma
 
Enhancing the Power of Salesforce with DevOps & Copado Webinar | SoftClouds D...
Enhancing the Power of Salesforce with DevOps & Copado Webinar | SoftClouds D...Enhancing the Power of Salesforce with DevOps & Copado Webinar | SoftClouds D...
Enhancing the Power of Salesforce with DevOps & Copado Webinar | SoftClouds D...SoftClouds LLC
 
Commit to the Cause, Push for Change: Contributing to Call for Code Open Sour...
Commit to the Cause, Push for Change: Contributing to Call for Code Open Sour...Commit to the Cause, Push for Change: Contributing to Call for Code Open Sour...
Commit to the Cause, Push for Change: Contributing to Call for Code Open Sour...Daniel Krook
 
UrbanCode Deploy course and product overview slides
UrbanCode Deploy course and product overview slidesUrbanCode Deploy course and product overview slides
UrbanCode Deploy course and product overview slidesIBM Rational software
 
Tokyo Release.pdf
Tokyo Release.pdfTokyo Release.pdf
Tokyo Release.pdfRajiv283486
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryAmazon Web Services
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryAmazon Web Services
 
DevSecOps 的規模化實踐 (Level: 300-400)
DevSecOps 的規模化實踐 (Level: 300-400)DevSecOps 的規模化實踐 (Level: 300-400)
DevSecOps 的規模化實踐 (Level: 300-400)Amazon Web Services
 
CI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and FargateCI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and FargateAmazon Web Services
 
SUGCON: The Agile Nirvana of DevSecOps and Containerization
SUGCON: The Agile Nirvana of DevSecOps and ContainerizationSUGCON: The Agile Nirvana of DevSecOps and Containerization
SUGCON: The Agile Nirvana of DevSecOps and ContainerizationVasiliy Fomichev
 

Similar to Automate Behavior-driven Development (DrupalCon Portland 2022) (20)

Automate Behavior-driven Development (Stanford WebCamp 2022)
Automate Behavior-driven Development (Stanford WebCamp 2022)Automate Behavior-driven Development (Stanford WebCamp 2022)
Automate Behavior-driven Development (Stanford WebCamp 2022)
 
DevOps+ to Leverage Software Development
DevOps+ to Leverage Software DevelopmentDevOps+ to Leverage Software Development
DevOps+ to Leverage Software Development
 
Mainframe DevOps: A Zowe CLI-enabled Roadmap
Mainframe DevOps: A Zowe CLI-enabled RoadmapMainframe DevOps: A Zowe CLI-enabled Roadmap
Mainframe DevOps: A Zowe CLI-enabled Roadmap
 
Agile practice in drupal 8 module development 20200328a
Agile practice in drupal 8 module development 20200328aAgile practice in drupal 8 module development 20200328a
Agile practice in drupal 8 module development 20200328a
 
A11yTC MeetUp: Role-based Analysis of WCAG 2.2
A11yTC MeetUp: Role-based Analysis of WCAG 2.2A11yTC MeetUp: Role-based Analysis of WCAG 2.2
A11yTC MeetUp: Role-based Analysis of WCAG 2.2
 
DevOps for Mainframe: Open Source Fast Track
DevOps for Mainframe: Open Source Fast TrackDevOps for Mainframe: Open Source Fast Track
DevOps for Mainframe: Open Source Fast Track
 
Optimize your CI/CD with GitLab and AWS
Optimize your CI/CD with GitLab and AWSOptimize your CI/CD with GitLab and AWS
Optimize your CI/CD with GitLab and AWS
 
CSUN 2022 Role-based analysis update: WCAG 2.2
CSUN 2022 Role-based analysis update: WCAG 2.2CSUN 2022 Role-based analysis update: WCAG 2.2
CSUN 2022 Role-based analysis update: WCAG 2.2
 
Software Factory Tools Partner Day Final
Software Factory Tools Partner Day FinalSoftware Factory Tools Partner Day Final
Software Factory Tools Partner Day Final
 
CampDevOps keynote - DevOps: Using 'Lean' to eliminate Bottlenecks
CampDevOps keynote - DevOps: Using 'Lean' to eliminate BottlenecksCampDevOps keynote - DevOps: Using 'Lean' to eliminate Bottlenecks
CampDevOps keynote - DevOps: Using 'Lean' to eliminate Bottlenecks
 
Enhancing the Power of Salesforce with DevOps & Copado Webinar | SoftClouds D...
Enhancing the Power of Salesforce with DevOps & Copado Webinar | SoftClouds D...Enhancing the Power of Salesforce with DevOps & Copado Webinar | SoftClouds D...
Enhancing the Power of Salesforce with DevOps & Copado Webinar | SoftClouds D...
 
Commit to the Cause, Push for Change: Contributing to Call for Code Open Sour...
Commit to the Cause, Push for Change: Contributing to Call for Code Open Sour...Commit to the Cause, Push for Change: Contributing to Call for Code Open Sour...
Commit to the Cause, Push for Change: Contributing to Call for Code Open Sour...
 
Overview
OverviewOverview
Overview
 
UrbanCode Deploy course and product overview slides
UrbanCode Deploy course and product overview slidesUrbanCode Deploy course and product overview slides
UrbanCode Deploy course and product overview slides
 
Tokyo Release.pdf
Tokyo Release.pdfTokyo Release.pdf
Tokyo Release.pdf
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & Delivery
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & Delivery
 
DevSecOps 的規模化實踐 (Level: 300-400)
DevSecOps 的規模化實踐 (Level: 300-400)DevSecOps 的規模化實踐 (Level: 300-400)
DevSecOps 的規模化實踐 (Level: 300-400)
 
CI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and FargateCI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and Fargate
 
SUGCON: The Agile Nirvana of DevSecOps and Containerization
SUGCON: The Agile Nirvana of DevSecOps and ContainerizationSUGCON: The Agile Nirvana of DevSecOps and Containerization
SUGCON: The Agile Nirvana of DevSecOps and Containerization
 

More from DOCOMO Innovations, Inc.

Empower Your Single Site for Multi-tenancy Services (Stanford WebCamp 2023)
Empower Your Single Site for Multi-tenancy Services (Stanford WebCamp 2023)Empower Your Single Site for Multi-tenancy Services (Stanford WebCamp 2023)
Empower Your Single Site for Multi-tenancy Services (Stanford WebCamp 2023)DOCOMO Innovations, Inc.
 
クラウドオーケストレーターを使ってみよう
クラウドオーケストレーターを使ってみようクラウドオーケストレーターを使ってみよう
クラウドオーケストレーターを使ってみようDOCOMO Innovations, Inc.
 
Leveraging Multiple Cloud Orchestration and Resource Optimization
Leveraging Multiple Cloud Orchestration and Resource OptimizationLeveraging Multiple Cloud Orchestration and Resource Optimization
Leveraging Multiple Cloud Orchestration and Resource OptimizationDOCOMO Innovations, Inc.
 
Agile Practice in Drupal 8 Module Development
Agile Practice in Drupal 8 Module DevelopmentAgile Practice in Drupal 8 Module Development
Agile Practice in Drupal 8 Module DevelopmentDOCOMO Innovations, Inc.
 
CouchConf Tokyo Customer Presentation: DOCOMO Innovations (Japanese)
CouchConf Tokyo Customer Presentation: DOCOMO Innovations (Japanese)CouchConf Tokyo Customer Presentation: DOCOMO Innovations (Japanese)
CouchConf Tokyo Customer Presentation: DOCOMO Innovations (Japanese)DOCOMO Innovations, Inc.
 
CouchConf Tokyo Customer Presentation: DOCOMO Innovations (English)
CouchConf Tokyo Customer Presentation: DOCOMO Innovations (English)CouchConf Tokyo Customer Presentation: DOCOMO Innovations (English)
CouchConf Tokyo Customer Presentation: DOCOMO Innovations (English)DOCOMO Innovations, Inc.
 
CouchConf Tokyo DOCOMO Innovations Lunchtime Lightning Talk (English)
CouchConf Tokyo DOCOMO Innovations Lunchtime Lightning Talk (English)CouchConf Tokyo DOCOMO Innovations Lunchtime Lightning Talk (English)
CouchConf Tokyo DOCOMO Innovations Lunchtime Lightning Talk (English)DOCOMO Innovations, Inc.
 
Clanavi: How to Manage Your Cloud by Drupal (BADCamp 2010)
Clanavi: How to Manage Your Cloud by Drupal (BADCamp 2010)Clanavi: How to Manage Your Cloud by Drupal (BADCamp 2010)
Clanavi: How to Manage Your Cloud by Drupal (BADCamp 2010)DOCOMO Innovations, Inc.
 
Clanavi: How to Manage Your Cloud by Drupal
Clanavi: How to Manage Your Cloud by DrupalClanavi: How to Manage Your Cloud by Drupal
Clanavi: How to Manage Your Cloud by DrupalDOCOMO Innovations, Inc.
 
How to Manage Your Cloud by Drupal (DrupalCon CPH 2010)
How to Manage Your Cloud by Drupal (DrupalCon CPH 2010)How to Manage Your Cloud by Drupal (DrupalCon CPH 2010)
How to Manage Your Cloud by Drupal (DrupalCon CPH 2010)DOCOMO Innovations, Inc.
 

More from DOCOMO Innovations, Inc. (12)

Empower Your Single Site for Multi-tenancy Services (Stanford WebCamp 2023)
Empower Your Single Site for Multi-tenancy Services (Stanford WebCamp 2023)Empower Your Single Site for Multi-tenancy Services (Stanford WebCamp 2023)
Empower Your Single Site for Multi-tenancy Services (Stanford WebCamp 2023)
 
クラウドオーケストレーターを使ってみよう
クラウドオーケストレーターを使ってみようクラウドオーケストレーターを使ってみよう
クラウドオーケストレーターを使ってみよう
 
Leveraging Multiple Cloud Orchestration and Resource Optimization
Leveraging Multiple Cloud Orchestration and Resource OptimizationLeveraging Multiple Cloud Orchestration and Resource Optimization
Leveraging Multiple Cloud Orchestration and Resource Optimization
 
Agile Practice in Drupal 8 Module Development
Agile Practice in Drupal 8 Module DevelopmentAgile Practice in Drupal 8 Module Development
Agile Practice in Drupal 8 Module Development
 
Leveraging Multiple Cloud Orchestration
Leveraging Multiple Cloud OrchestrationLeveraging Multiple Cloud Orchestration
Leveraging Multiple Cloud Orchestration
 
Leveraging Multiple Cloud Orchestration
Leveraging Multiple Cloud OrchestrationLeveraging Multiple Cloud Orchestration
Leveraging Multiple Cloud Orchestration
 
CouchConf Tokyo Customer Presentation: DOCOMO Innovations (Japanese)
CouchConf Tokyo Customer Presentation: DOCOMO Innovations (Japanese)CouchConf Tokyo Customer Presentation: DOCOMO Innovations (Japanese)
CouchConf Tokyo Customer Presentation: DOCOMO Innovations (Japanese)
 
CouchConf Tokyo Customer Presentation: DOCOMO Innovations (English)
CouchConf Tokyo Customer Presentation: DOCOMO Innovations (English)CouchConf Tokyo Customer Presentation: DOCOMO Innovations (English)
CouchConf Tokyo Customer Presentation: DOCOMO Innovations (English)
 
CouchConf Tokyo DOCOMO Innovations Lunchtime Lightning Talk (English)
CouchConf Tokyo DOCOMO Innovations Lunchtime Lightning Talk (English)CouchConf Tokyo DOCOMO Innovations Lunchtime Lightning Talk (English)
CouchConf Tokyo DOCOMO Innovations Lunchtime Lightning Talk (English)
 
Clanavi: How to Manage Your Cloud by Drupal (BADCamp 2010)
Clanavi: How to Manage Your Cloud by Drupal (BADCamp 2010)Clanavi: How to Manage Your Cloud by Drupal (BADCamp 2010)
Clanavi: How to Manage Your Cloud by Drupal (BADCamp 2010)
 
Clanavi: How to Manage Your Cloud by Drupal
Clanavi: How to Manage Your Cloud by DrupalClanavi: How to Manage Your Cloud by Drupal
Clanavi: How to Manage Your Cloud by Drupal
 
How to Manage Your Cloud by Drupal (DrupalCon CPH 2010)
How to Manage Your Cloud by Drupal (DrupalCon CPH 2010)How to Manage Your Cloud by Drupal (DrupalCon CPH 2010)
How to Manage Your Cloud by Drupal (DrupalCon CPH 2010)
 

Recently uploaded

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 

Recently uploaded (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

Automate Behavior-driven Development (DrupalCon Portland 2022)

  • 1. Automate Behavior-driven Development Yas Naoi Chief Architect, Cloud DOCOMO Innovatins, Inc.
  • 2. Yas 2 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
  • 3. Yas 3 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. • Chief Architect, Cloud
  • 4. Yas 4 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. • Chief Architect, Cloud • DOCOMO Innovations, Inc. (Palo Alto, CA) • NTT DOCOMO Inc.
  • 5. Yas • Chief Architect, Cloud • DOCOMO Innovations, Inc. (Palo Alto, CA) • NTT DOCOMO Inc. • Cloud, DevOps, Agile Software Development • d.o: 17 years 5 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
  • 6. Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 6 Our Team
  • 7. Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 7 / Cloud Team Members /
  • 8. Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 8 / Cloud Team Members / CA Yas Baldwin Kumiko Tatsuya Hiroki Tamaki
  • 9. Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 9 / Cloud Team Members / India Sachin CA Yas Baldwin Kumiko Tatsuya Hiroki Tamaki
  • 10. Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 10 / Cloud Team Members / Japan Xiaohua Takumaru Masami Ryo Tomohiro India Sachin CA Yas Baldwin Kumiko Tatsuya Hiroki Tamaki Shota Makoto
  • 11. 11 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. Cloud Orchestrator Search: drupal cloud orchestrator
  • 12. 12 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. Cloud Orchestrator Search: drupal cloud orchestrator
  • 13. Multi-cloud Support ────────────── 13 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. Cloud Orchestrator
  • 14. Multi-cloud Support ────────────── § AWS 14 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. Cloud Orchestrator
  • 15. Multi-cloud Support ────────────── § AWS § Kubernetes 15 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. Cloud Orchestrator
  • 16. Multi-cloud Support ────────────── § AWS § Kubernetes § OpenStack 16 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. Cloud Orchestrator
  • 17. Multi-cloud Support ────────────── § AWS § Kubernetes § OpenStack § VMware 17 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. Cloud Orchestrator
  • 18. Multi-cloud Support ────────────── § AWS § Kubernetes § OpenStack § VMware § Terraform Cloud 18 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. Cloud Orchestrator
  • 19. Agenda 19 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
  • 20. Agenda • Development Model • What’s Behat for Behavior-driven Development (BDD) • Templating for Behat Test Scenarios • Automated Testing for BDD 20 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
  • 22. Software Development Lifecycle Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 22
  • 23. Software Development Lifecycle Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 23 Coding Integration Testing Component Design Function Design Unit Testing System Requirements System Testing Business Requirements Acceptance Testing V-model [Boehm 79]
  • 24. Software Development Lifecycle Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 24 Business Requirements V-model [Boehm 79]
  • 25. Software Development Lifecycle Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 25 System Requirements Business Requirements V-model [Boehm 79]
  • 26. Software Development Lifecycle Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 26 Component Design System Requirements Business Requirements V-model [Boehm 79]
  • 27. Software Development Lifecycle Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 27 Component Design Function Design System Requirements Business Requirements V-model [Boehm 79]
  • 28. Software Development Lifecycle Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 28 Coding Component Design Function Design System Requirements Business Requirements V-model [Boehm 79]
  • 29. Software Development Lifecycle Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 29 Coding Component Design Function Design Unit Testing System Requirements Business Requirements V-model [Boehm 79]
  • 30. Software Development Lifecycle Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 30 Coding Integration Testing Component Design Function Design Unit Testing System Requirements Business Requirements V-model [Boehm 79]
  • 31. Software Development Lifecycle Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 31 Coding Integration Testing Component Design Function Design Unit Testing System Requirements System Testing Business Requirements V-model [Boehm 79]
  • 32. Software Development Lifecycle Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 32 Coding Integration Testing Component Design Function Design Unit Testing System Requirements System Testing Business Requirements Acceptance Testing V-model [Boehm 79]
  • 33. Software Development Lifecycle Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 33 Coding Integration Testing Component Design Function Design Unit Testing System Requirements System Testing Business Requirements Acceptance Testing V-model [Boehm 79]
  • 34. Software Development Lifecycle Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 34 Coding Integration Testing Component Design Function Design Unit Testing System Requirements System Testing Business Requirements Acceptance Testing TDD V-model [Boehm 79]
  • 35. Software Development Lifecycle Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 35 Coding Integration Testing Component Design Function Design Unit Testing System Requirements System Testing Business Requirements Acceptance Testing TDD BDD V-model [Boehm 79]
  • 36. Software Development Lifecycle Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 36 Coding Integration Testing Component Design Function Design Unit Testing System Requirements System Testing Business Requirements Acceptance Testing TDD BDD ATDD V-model [Boehm 79]
  • 37. Software Development Lifecycle Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 37 Coding Integration Testing Component Design Function Design Unit Testing System Requirements System Testing Business Requirements Acceptance Testing V-model [Boehm 79] ✔TDD BDD ATDD PHPUnit (Drupal)
  • 38. Software Development Lifecycle Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 38 Coding Integration Testing Component Design Function Design Unit Testing System Requirements System Testing Business Requirements Acceptance Testing V-model [Boehm 79] ✔TDD ✔BDD (ATDD) PHPUnit (Drupal) Behat+ Drupal Extension
  • 40. PHPUnit Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 40 /** * Tests CRUD for K8s node. * * @throws Exception */ public function testNode(): void { $cloud_context = $this->cloudContext; $data = $this->createNodeTestFormData(self::K8S_NODE_REPEAT_COUNT); $this->updateNodesMockData($data); // Update k8s nodes. $this->drupalGet("/clouds/k8s/$cloud_context/node/update"); $this->assertNoErrorMessage(); for ($i = 0; $i < self::K8S_NODE_REPEAT_COUNT; $i++) { $this->assertSession()->pageTextContains($data[$i]['name']); } for ($i = 0, $num = 1; $i < self::K8S_NODE_REPEAT_COUNT; $i++, $num++) { // Make sure the all node listing exists. $this->drupalGet('/clouds/k8s/node'); $this->assertNoErrorMessage(); for ($j = 0; $j < $num; $j++) { $this->assertSession()->pageTextContains($data[$j]['name']); } } }
  • 41. BDD Test Scenario Example by Behat Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 41 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" |
  • 43. Behat + drupal-extension + Chrome Driver 2022 DOCOMO Innovations, Inc. All Rights Reserved. Confidential. 43 Application under Test (AUT) Test Framework
  • 44. Behat + drupal-extension + Chrome Driver 2022 DOCOMO Innovations, Inc. All Rights Reserved. Confidential. 44 Test Framework
  • 45. Behat + drupal-extension + Chrome Driver 2022 DOCOMO Innovations, Inc. All Rights Reserved. Confidential. Test Framework Features in Gherkin 45
  • 46. Behat + drupal-extension + Chrome Driver 2022 DOCOMO Innovations, Inc. All Rights Reserved. Confidential. Test Framework Features in Gherkin Drupal Ext. Drush Ext. API Driver 46
  • 47. Behat + drupal-extension + Chrome Driver 2022 DOCOMO Innovations, Inc. All Rights Reserved. Confidential. Test Framework Features in Gherkin Drupal Ext. Drush Ext. API Driver Mink Ext. Chrome Ext. WebDriver 47
  • 48. Behat + drupal-extension + Chrome Driver 2022 DOCOMO Innovations, Inc. All Rights Reserved. Confidential. Chrome Driver Test Framework Features in Gherkin Drupal Ext. Drush Ext. API Driver Mink Ext. Chrome Ext. WebDriver WebDriver Implementation 48
  • 49. Behat + drupal-extension + Chrome Driver 2022 DOCOMO Innovations, Inc. All Rights Reserved. Confidential. Chrome Driver Headless Browser Test Framework Features in Gherkin Drupal Ext. Drush Ext. API Driver Mink Ext. Chrome Ext. WebDriver WebDriver Implementation << Native API >> 49
  • 50. Behat + drupal-extension + Chrome Driver 2022 DOCOMO Innovations, Inc. All Rights Reserved. Confidential. Application under Test (AUT) Chrome Driver Headless Browser << Native API >> << HTTP >> Test Framework Features in Gherkin Drupal Ext. Drush Ext. API Driver Mink Ext. Chrome Ext. WebDriver WebDriver Implementation 50
  • 52. Behat (Gherkin) Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 52 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" |
  • 53. Behat (Gherkin) Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 53 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" |
  • 54. Behat (Gherkin) Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 54 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" |
  • 55. Behat (Gherkin) Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 55 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" |
  • 56. Behat (Gherkin) Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 56 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" |
  • 57. Behat (Gherkin) Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 57 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" |
  • 58. Behat (Gherkin) Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 58 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" |
  • 59. Behat (Gherkin) Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 59 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" |
  • 60. Behat (Gherkin) Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 60 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" |
  • 61. Behat (Gherkin) Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 61 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" |
  • 62. Behat (Gherkin) Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 62 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" |
  • 63. Behat (Gherkin) Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 63 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" |
  • 64. Behat (Gherkin) Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 64 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" | Initial State / Condition
  • 65. Behat (Gherkin) Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 65 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" | Action Take Place
  • 66. Behat (Gherkin) Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 66 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" | Expected Result
  • 67. Can I use parameters? 67
  • 68. I want to use parameters in scenarios! Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 68 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" |
  • 69. I want to use parameters in scenarios! Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 69 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" |
  • 70. I want to use parameters in scenarios! Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 70 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" |
  • 71. I want to use parameters in scenarios! Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 71 Feature: Login, Check the Clean State, and Logout In order to list resources on the clean state As a user I need to have both Drupal and AWS IAM permissions Scenario: Log in as "Anonymous user" Given I am not logged in When I visit "/clouds" Then I should be on "/user/login" And I should see the heading "Log in" Scenario Outline: Access cloud service providers Given I am logged in as a user with the <role> role And I should not see the link "All" in the "nav_bar" And I should <verb> "Add cloud service provider" in the "nav_bar" When I go to "/clouds" Then I should be on "/admin/structure/cloud_config/add" And I should get a <code> HTTP response And I should see the heading <heading> Examples: | role | verb | code | heading | | "Authenticated user" | not see | 403 | "Access denied" | | "Cloud administrator" | see | 200 | "Add cloud service provider" | | "Administrator" | see | 200 | "Add cloud service provider" |
  • 72. How it works by natural language? 72
  • 73. The Tricks Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 73 /** * Log in as the existing user * * @Given I am logged in as user :name */ public function iAmLoggedInAsUser($name): void { $user = user_load_by_name($name); $this->getSession()->visit(user_pass_reset_url($user) . '/login'); }
  • 74. The Tricks Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 74 /** * Log in as the existing user * * @Given I am logged in as user :name */ public function iAmLoggedInAsUser($name): void { $user = user_load_by_name($name); $this->getSession()->visit(user_pass_reset_url($user) . '/login'); } Sentence
  • 75. The Tricks Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 75 /** * Log in as the existing user * * @Given I am logged in as user :name */ public function iAmLoggedInAsUser($name): void { $user = user_load_by_name($name); $this->getSession()->visit(user_pass_reset_url($user) . '/login'); } Parameter Variable
  • 76. The Tricks Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 76 /** * Check if the current page contains no messages of the specified selector. * * @Then /^I should see no (?P<selector>(?:success|error|warning)) message$/ */ public function assertSelectorNotVisible($selector): void { switch ($selector) { case 'success': $selector_id = 'success_message_selector'; break; case 'error': $selector_id = 'error_message_selector'; break; case 'warning': $selector_id = 'warning_message_selector'; break; default: throw new ExpectationException(sprintf("Message type is invalid: %s", $selector), $this->getSession()->getDriver()); } $this->assertNotVisible($selector_id); } Regular Expression
  • 77. But scenario outline is not enough! 77
  • 78. I want to use parameters for everything! Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 78 Scenario Outline: Launch an EC2 instance Given I am logged in as user "{{ user_name }}" When I visit "/clouds/design/server_template/" And I click <instance_name>{{ cloud_context }} And I click "Launch" And the url should match "/launch" And I check the box "Automatically terminate instance" And I press "Launch" Then I should be on "/clouds/aws_cloud/{{ cloud_context }}/instance" And I should see "pending" in the <instance_name> row And I should see <instance_type> in the <instance_name> row And I should see "{{ availability_zone }}" in the <instance_name> row Examples: | instance_name | instance_type | | "{{ instance_name_1 }}" | "{{ instance_type_1 }}" | | "{{ instance_name_2 }}" | "{{ instance_type_2 }}" |
  • 79. I want to use parameters for everything! Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 79 Scenario Outline: Launch an EC2 instance Given I am logged in as user "{{ user_name }}" When I visit "/clouds/design/server_template/" And I click <instance_name>{{ cloud_context }} And I click "Launch" And the url should match "/launch" And I check the box "Automatically terminate instance" And I press "Launch" Then I should be on "/clouds/aws_cloud/{{ cloud_context }}/instance" And I should see "pending" in the <instance_name> row And I should see <instance_type> in the <instance_name> row And I should see "{{ availability_zone }}" in the <instance_name> row Examples: | instance_name | instance_type | | "{{ instance_name_1 }}" | "{{ instance_type_1 }}" | | "{{ instance_name_2 }}" | "{{ instance_type_2 }}" | Twig Template!
  • 81. Get Parameterized Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 81
  • 82. Get Parameterized Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 82 docker build
  • 83. Get Parameterized Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 83 docker build RUN composer require drupal/cloud drupal/drupal-extension ...
  • 84. Get Parameterized Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 84 Packagist: drupal/cloud_orchestrator incl. drupal/cloud Feature: ... Scenario Outline: ... Examples: docker build RUN composer require drupal/cloud drupal/drupal-extension ... << Download >>
  • 85. Get Parameterized Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 85 docker run docomoinnovations/cloud_orchestrator Packagist: drupal/cloud_orchestrator incl. drupal/cloud Feature: ... Scenario Outline: ... Examples: docker build RUN composer require drupal/cloud drupal/drupal-extension ... << Download >> << docker run >>
  • 86. Get Parameterized Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 86 docker run docomoinnovations/cloud_orchestrator Run drush cloud:behat:preprocess • Read a YAML file whih contains parameter mappings • Replace {{...}} as an input variable Packagist: drupal/cloud_orchestrator incl. drupal/cloud Feature: ... Scenario Outline: ... Examples: docker build RUN composer require drupal/cloud drupal/drupal-extension ... << Download >> << docker run >>
  • 87. Get Parameterized Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 87 docker run docomoinnovations/cloud_orchestrator Run drush cloud:behat:preprocess • Read a YAML file whih contains parameter mappings • Replace {{...}} as an input variable private_params.yml e.g. This is a placeholder: Cloud Orchestrator Packagist: drupal/cloud_orchestrator incl. drupal/cloud Feature: ... Scenario Outline: ... Examples: docker build RUN composer require drupal/cloud drupal/drupal-extension ... << Read parameter files>> << Download >> << docker run >>
  • 88. Get Parameterized Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 88 docker run docomoinnovations/cloud_orchestrator Run drush cloud:behat:preprocess • Read a YAML file whih contains parameter mappings • Replace {{...}} as an input variable Feature: ... Scenario Outline: ... ...<This is a placeholder>... Examples: | This is a placeholder | | {{This is a placeholder}} | private_params.yml e.g. This is a placeholder: Cloud Orchestrator Packagist: drupal/cloud_orchestrator incl. drupal/cloud Feature: ... Scenario Outline: ... Examples: docker build RUN composer require drupal/cloud drupal/drupal-extension ... << Read parameter files>> << Read Feature template files>> << Download >> << docker run >>
  • 89. Get Parameterized Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 89 docker run docomoinnovations/cloud_orchestrator Run drush cloud:behat:preprocess • Read a YAML file whih contains parameter mappings • Replace {{...}} as an input variable Feature: ... Scenario Outline: ... ...<This is a placeholder>... Examples: | This is a placeholder | | {{This is a placeholder}} | private_params.yml e.g. This is a placeholder: Cloud Orchestrator Feature: ... Scenario Outline: ... ...<This is a placeholder>... Examples: | This is a placeholder | | Cloud Orchestrator | Packagist: drupal/cloud_orchestrator incl. drupal/cloud Feature: ... Scenario Outline: ... Examples: docker build RUN composer require drupal/cloud drupal/drupal-extension ... << Read parameter files>> << Read Feature template files>> << Output actual feature files>> << Download >> << docker run >>
  • 90. Get Parameterized Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 90 docker run docomoinnovations/cloud_orchestrator Run drush cloud:behat:preprocess • Read a YAML file whih contains parameter mappings • Replace {{...}} as an input variable Run behat command run_behat.sh Feature: ... Scenario Outline: ... ...<This is a placeholder>... Examples: | This is a placeholder | | {{This is a placeholder}} | private_params.yml e.g. This is a placeholder: Cloud Orchestrator Feature: ... Scenario Outline: ... ...<This is a placeholder>... Examples: | This is a placeholder | | Cloud Orchestrator | Packagist: drupal/cloud_orchestrator incl. drupal/cloud Feature: ... Scenario Outline: ... Examples: docker build RUN composer require drupal/cloud drupal/drupal-extension ... << Read parameter files>> << Read Feature template files>> << Output actual feature files>> << Read feature files>> << Download >> << docker run >>
  • 91. Get Parameterized Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 91 docker run docomoinnovations/cloud_orchestrator Run drush cloud:behat:preprocess • Read a YAML file whih contains parameter mappings • Replace {{...}} as an input variable Run behat command run_behat.sh Feature: ... Scenario Outline: ... ...<This is a placeholder>... Examples: | This is a placeholder | | {{This is a placeholder}} | private_params.yml e.g. This is a placeholder: Cloud Orchestrator Feature: ... Scenario Outline: ... ...<This is a placeholder>... Examples: | This is a placeholder | | Cloud Orchestrator | Execute BDD tests and get Output Packagist: drupal/cloud_orchestrator incl. drupal/cloud Feature: ... Scenario Outline: ... Examples: docker build RUN composer require drupal/cloud drupal/drupal-extension ... << Process features >> << Read parameter files>> << Read Feature template files>> << Output actual feature files>> << Read feature files>> << docker run >> << Download >>
  • 93. We Test Our Code Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 93
  • 94. We Want This One! Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 94
  • 95. GitLab CI/CD Pipeline Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 95
  • 96. GitLab CI/CD Pipeline Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 96
  • 97. GitLab CI/CD Pipeline Architecture Basics Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 97
  • 98. Developer GitLab CI/CD Pipeline Architecture Basics Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 98
  • 99. Developer GitLab CI/CD Pipeline Architecture Basics GitLab Master Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 99
  • 100. GitLab Master GitLab Runner Developer GitLab CI/CD Pipeline Architecture Basics Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 100
  • 101. GitLab Master GitLab Repository Developer GitLab CI/CD Pipeline Architecture Basics GitLab Runner Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 101
  • 102. GitLab Master CI/CD Pipeline GitLab Repository Developer GitLab CI/CD Pipeline Architecture Basics GitLab Runner Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 102
  • 103. GitLab Master GitLab Runner CI/CD Pipeline GitLab Repository Developer gitlab-runner 1 gitlab-runner 2 … gitlab-runner N GitLab CI/CD Pipeline Architecture Basics Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 103
  • 104. GitLab Master GitLab Runner GitLab Container Registry CI/CD Pipeline GitLab Repository Developer GitLab CI/CD Pipeline Architecture Basics Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 104 gitlab-runner 1 gitlab-runner 2 … gitlab-runner N
  • 105. GitLab Master GitLab Runner CI/CD Pipeline GitLab Repository Developer GitLab CI/CD Pipeline Architecture Basics GitLab Container Registry Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 105 gitlab-runner 1 gitlab-runner 2 … gitlab-runner N
  • 106. GitLab Master GitLab Runner CI/CD Pipeline GitLab Repository Developer GitLab CI/CD Pipeline Architecture Basics GitLab Container Registry Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 106 gitlab-runner 1 gitlab-runner 2 … gitlab-runner N
  • 107. GitLab Master GitLab Runner CI/CD Pipeline GitLab Repository Developer GitLab CI/CD Pipeline Architecture Basics GitLab Container Registry Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 107 gitlab-runner 1 gitlab-runner 2 … gitlab-runner N
  • 108. GitLab Master GitLab Runner CI/CD Pipeline GitLab Repository Developer GitLab CI/CD Pipeline Architecture Basics GitLab Container Registry Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 108 gitlab-runner 1 gitlab-runner 2 … gitlab-runner N
  • 109. EC2 Our GitLab CI/CD Pipeline Architecture GitLab Master (SaaS) CI/CD Pipeline GitLab Repository Developer Slack GitLab Container Registry Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 109 gitlab-runner 1 gitlab-runner 2 gitlab-runner 3 gitlab-runner 4
  • 110. Slack Integration Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 110
  • 111. How we can build CI/CD pipeline? 111
  • 112. .gitlab-ci.yml Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 112 stages: - run_tests - .post variables: UPDATE: 20220408a WEB_ROOT: '/var/www/html/web' CLOUD_HOME: "${WEB_ROOT}/modules/contrib/cloud" BROWSER_OUTPUT: "${WEB_ROOT}/sites/simpletest/browser_output/" IMAGE_TAG: 9.4.x-arm64 .preprocess_template: &preprocess_definition image: name: "${CI_REGISTRY_IMAGE}:${IMAGE_TAG}" stage: run_tests only: - branches # - merge_requests before_script: | whoami sudo service apache2 start sudo service memcached start sudo mkdir -p "${WEB_ROOT}/simpletest/${CI_PIPELINE_ID}" sudo mount -t tmpfs -o size=8G tmpfs "${WEB_ROOT}/simpletest/${CI_PIPELINE_ID}" sudo chmod 777 -R "${WEB_ROOT}/simpletest" rm -rf "${CLOUD_HOME}" && cp -ar "${PWD}" "${CLOUD_HOME}” .artifacts_template: &postprocess_definition after_script: | mkdir -p "${BROWSER_OUTPUT}" if [ -d "${BROWSER_OUTPUT}" ]; then cp -ar "${BROWSER_OUTPUT}" "${CI_PROJECT_DIR}/"; else mkdir -p "${BROWSER_OUTPUT}" && touch "${BROWSER_OUTPUT}/NO_ARTIFACTS.txt"; fi php -v drush status ...
  • 113. .gitlab-ci.yml • Describe the pipeline definition in one YAML file • Put root (top) directory of your branch • Get started – https://docs.gitlab.com/ee/ci/quick_start/ Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 113
  • 114. Demo Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 114 • Behat • GitLab CI/CD Pipeline
  • 115. Lessons That We Learned 115
  • 116. Our Custom Extension to drupal-extension 1. Logged in as the existing user without password – Using drush user:login 2. Take a screenshot, which is very useful in troubleshooting – Not only with Selenium + @javascript, but Chrome Extension or w/o @javascript 3. Specifying a region with the row index of a table – Especially when the same labels are used in multiple rows 4. Assert only the success message shows – Namely, neither error or warning messages show 116 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
  • 117. Our Custom Extension to drupal-extension 117 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 1. Logged in as the existing user without password – Using drush user:login 2. Take a screenshot, which is very useful in troubleshooting – Not only with Selenium + @javascript, but Chrome Extension or w/o @javascript annotation 3. Specifying a region with the row index of a table – Especially when the same labels are used in multiple rows 4. Assert only the success message shows – Namely, neither error or warning messages show
  • 118. 1. Logged in as the existing user without password – Using drush user:login 2. Take a screenshot, which is very useful in troubleshooting – Not only with Selenium + @javascript, but Chrome Extension or w/o @javascript annotation 3. Specifying a region with the row index of a table – Especially when the same labels are used in multiple rows 4. Assert only the success message shows – Namely, neither error or warning messages show Our Custom Extension to drupal-extension 118 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
  • 119. 1. Logged in as the existing user without password – Using drush user:login 2. Take a screenshot, which is very useful in troubleshooting – Not only with Selenium + @javascript, but Chrome Extension or w/o @javascript annotation 3. Specifying a region with the row index of a table – Especially when the same labels are used in multiple rows 4. Assert only the success message shows – Namely, neither error or warning messages show Our Custom Extension to drupal-extension 119 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
  • 120. Our Custom Extension to drupal-extension 120 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved. 1. Logged in as the existing user without password – Using drush user:login 2. Take a screenshot, which is very useful in troubleshooting – Not only with Selenium + @javascript, but Chrome Extension or w/o @javascript annotation 3. Specifying a region with the row index of a table – Especially when the same labels are used in multiple rows 4. Assert only the success message shows – Namely, neither error or warning messages show
  • 121. Known Issues: Solutions 1. User login sometimes fails due to "Username" is not found – Workaround: add a longer sleep after chromium started 2. The text in checkbox/link is visible, but not ready to be clicked – Add 500 ms sleep before such action 3. Cannot distinguish DOM objects if the same text are set – For the table rows 4. Cannot login with a role created in the same Behat process – Workaround: divide a feature file to run Behat for each – Avoid using login with such role 121 Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
  • 123. Where to Find Our Solutions 123 • Behat feature files & configurations – https://git.drupalcode.org/project/cloud/-/tree/5.x/tests/src/Behat – https://git.drupalcode.org/project/cloud/-/tree/5.x/modules/cloud_service_providers/aws_cloud/tests/src/Behat – https://git.drupalcode.org/project/cloud/-/tree/5.x/modules/cloud_service_providers/k8s/tests/src/Behat • Drupal extensions with our custom functions – https://github.com/docomoinnovations/drupalextension Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
  • 124. Resources 124 • Cloud Orchestrator – https://drupal.org/project/cloud – https://cloud.airgap.host • YouTube Channel – https://bit.ly/2TJssME Copyright © 2022 DOCOMO Innovations, Inc. All Rights Reserved.
  • 125. Coming together is a beginning, keeping together is a progress; working together is a success. Henry Ford “ “