Skip to content

Commit b6f959a

Browse files
authored
GitHub workflows (#369)
Add integration workflows for services: - BlockStorage - Compute - Images - Networking
1 parent 42e66d8 commit b6f959a

File tree

11 files changed

+317
-16
lines changed

11 files changed

+317
-16
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Run Block Storage Integration Tests
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths:
7+
- '**BlockStorage**'
8+
- '**Common**'
9+
10+
jobs:
11+
tests:
12+
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
openstack_version: [ "stable/wallaby" ] # v2 is removed from xena
17+
php_version: [ 8.1 ]
18+
ubuntu_version: [ 20.04 ]
19+
runs-on: ubuntu-${{ matrix.ubuntu_version }}
20+
name: Deploy OpenStack ${{ matrix.name }} and run Block Storage integration tests with php ${{matrix.php_version}}
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: get cache directory
24+
id: composer-cache
25+
run: |
26+
echo "::set-output name=dir::$(composer config cache-files-dir)"
27+
- uses: actions/cache@v3
28+
with:
29+
path: |
30+
~/.php_cs.cache
31+
${{ steps.composer-cache.outputs.dir }}
32+
key: ${{ runner.os }}-composer-${{ matrix.php_version }}-${{ hashFiles('**.composer.lock') }}
33+
restore-keys: |
34+
${{ runner.os }}-composer-${{ matrix.php_version }}-
35+
- uses: shivammathur/setup-php@v2
36+
with:
37+
php-version: ${{ matrix.php_version }}
38+
extensions: curl
39+
tools: composer:v2
40+
coverage: none
41+
- run: composer install --prefer-dist --no-interaction --no-progress
42+
- name: Restore devstack cache
43+
uses: actions/cache@v3
44+
with:
45+
path: |
46+
/opt/stack/*
47+
!/opt/stack/data
48+
~/devstack/
49+
key: ${{ runner.os }}-openstack-${{ matrix.openstack_version }}-${{ github.workflow }}
50+
- name: Deploy devstack
51+
uses: EmilienM/devstack-action@v0.11
52+
with:
53+
branch: ${{ matrix.openstack_version }}
54+
conf_overrides: |
55+
CINDER_ISCSI_HELPER=lioadm
56+
enabled_services: 's-account,s-container,s-object,s-proxy,s-bak'
57+
- name: Set env variables
58+
run: |
59+
{
60+
echo OS_AUTH_URL="$(grep -oP -m 1 "(?<=auth_url: )(.*)\$" /etc/openstack/clouds.yaml)/v3"
61+
echo OS_REGION=RegionOne
62+
echo OS_REGION_NAME=RegionOne
63+
echo OS_USER_ID=$(openstack --os-cloud=devstack-admin user show admin -f value -c id)
64+
echo OS_USERNAME=admin
65+
echo OS_PASSWORD=secret
66+
echo OS_PROJECT_ID=$(openstack --os-cloud=devstack-admin project show admin -f value -c id)
67+
echo OS_PROJECT_NAME=admin
68+
echo OS_RESIZE_FLAVOR=c1
69+
echo OS_FLAVOR=1
70+
echo OS_DOMAIN_ID=default
71+
} >> "$GITHUB_ENV"
72+
- name: Execute integration tests
73+
run: php ./tests/integration/run.php -s=BlockStorage
74+
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Run Compute Integration Tests
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
paths:
6+
- '**Compute**'
7+
- '**Common**'
8+
9+
jobs:
10+
tests:
11+
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
openstack_version: [ "stable/wallaby" ] # Cinder v2 is removed from xena
16+
php_version: [ 8.1 ]
17+
ubuntu_version: [ 20.04 ]
18+
runs-on: ubuntu-${{ matrix.ubuntu_version }}
19+
name: Deploy OpenStack ${{ matrix.name }} with Nova and run Compute integration tests with php ${{matrix.php_version}}
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: get cache directory
23+
id: composer-cache
24+
run: |
25+
echo "::set-output name=dir::$(composer config cache-files-dir)"
26+
- uses: actions/cache@v3
27+
with:
28+
path: |
29+
~/.php_cs.cache
30+
${{ steps.composer-cache.outputs.dir }}
31+
key: ${{ runner.os }}-composer-${{ matrix.php_version }}-${{ hashFiles('**.composer.lock') }}
32+
restore-keys: |
33+
${{ runner.os }}-composer-${{ matrix.php_version }}-
34+
- uses: shivammathur/setup-php@v2
35+
with:
36+
php-version: ${{ matrix.php_version }}
37+
extensions: curl
38+
tools: composer:v2
39+
coverage: none
40+
- run: composer install --prefer-dist --no-interaction --no-progress
41+
- name: Restore devstack cache
42+
uses: actions/cache@v3
43+
with:
44+
path: |
45+
/opt/stack/*
46+
!/opt/stack/data
47+
~/devstack/
48+
key: ${{ runner.os }}-openstack-${{ matrix.openstack_version }}-${{ github.workflow }}
49+
- name: Deploy devstack
50+
uses: EmilienM/devstack-action@v0.11
51+
with:
52+
branch: ${{ matrix.openstack_version }}
53+
conf_overrides: |
54+
CINDER_ISCSI_HELPER=lioadm
55+
enabled_services: 's-account,s-container,s-object,s-proxy,s-bak'
56+
- name: Set env variables
57+
run: |
58+
{
59+
echo OS_AUTH_URL="$(grep -oP -m 1 "(?<=auth_url: )(.*)\$" /etc/openstack/clouds.yaml)/v3"
60+
echo OS_REGION=RegionOne
61+
echo OS_REGION_NAME=RegionOne
62+
echo OS_USER_ID=$(openstack --os-cloud=devstack-admin user show admin -f value -c id)
63+
echo OS_USERNAME=admin
64+
echo OS_PASSWORD=secret
65+
echo OS_PROJECT_ID=$(openstack --os-cloud=devstack-admin project show admin -f value -c id)
66+
echo OS_PROJECT_NAME=admin
67+
echo OS_RESIZE_FLAVOR=c1
68+
echo OS_FLAVOR=1
69+
echo OS_DOMAIN_ID=default
70+
} >> "$GITHUB_ENV"
71+
- name: Execute integration tests
72+
run: php ./tests/integration/run.php -s=Compute
73+

.github/workflows/integration_identity.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
name: Run Identity Integration Tests
22
on:
3+
workflow_dispatch:
34
pull_request:
45
paths:
56
- '**Identity**'
7+
- '**Common**'
8+
69
jobs:
710
tests:
811
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
@@ -58,7 +61,7 @@ jobs:
5861
echo OS_PASSWORD=secret
5962
echo OS_PROJECT_ID=$(openstack --os-cloud=devstack-admin project show admin -f value -c id)
6063
echo OS_PROJECT_NAME=admin
61-
echo OS_RESIZE_FLAVOR=2
64+
echo OS_RESIZE_FLAVOR=c1
6265
echo OS_FLAVOR=1
6366
echo OS_DOMAIN_ID=default
6467
} >> "$GITHUB_ENV"
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Run Images Integration Tests
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
paths:
6+
- '**Images**'
7+
- '**Common**'
8+
9+
jobs:
10+
tests:
11+
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
openstack_version: [ "stable/zed" ]
16+
php_version: [ 8.1 ]
17+
ubuntu_version: [ 20.04 ]
18+
runs-on: ubuntu-${{ matrix.ubuntu_version }}
19+
name: Deploy OpenStack ${{ matrix.name }} with Glance and run Images integration tests with php ${{matrix.php_version}}
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: get cache directory
23+
id: composer-cache
24+
run: |
25+
echo "::set-output name=dir::$(composer config cache-files-dir)"
26+
- uses: actions/cache@v3
27+
with:
28+
path: |
29+
~/.php_cs.cache
30+
${{ steps.composer-cache.outputs.dir }}
31+
key: ${{ runner.os }}-composer-${{ matrix.php_version }}-${{ hashFiles('**.composer.lock') }}
32+
restore-keys: |
33+
${{ runner.os }}-composer-${{ matrix.php_version }}-
34+
- uses: shivammathur/setup-php@v2
35+
with:
36+
php-version: ${{ matrix.php_version }}
37+
extensions: curl
38+
tools: composer:v2
39+
coverage: none
40+
- run: composer install --prefer-dist --no-interaction --no-progress
41+
- name: Restore devstack cache
42+
uses: actions/cache@v3
43+
with:
44+
path: |
45+
/opt/stack/*
46+
!/opt/stack/data
47+
~/devstack/
48+
key: ${{ runner.os }}-openstack-${{ matrix.openstack_version }}-${{ github.workflow }}
49+
- name: Deploy devstack
50+
uses: EmilienM/devstack-action@v0.11
51+
with:
52+
branch: ${{ matrix.openstack_version }}
53+
conf_overrides: |
54+
CINDER_ISCSI_HELPER=lioadm
55+
- name: Set env variables
56+
run: |
57+
{
58+
echo OS_AUTH_URL="$(grep -oP -m 1 "(?<=auth_url: )(.*)\$" /etc/openstack/clouds.yaml)/v3"
59+
echo OS_REGION=RegionOne
60+
echo OS_REGION_NAME=RegionOne
61+
echo OS_USER_ID=$(openstack --os-cloud=devstack-admin user show admin -f value -c id)
62+
echo OS_USERNAME=admin
63+
echo OS_PASSWORD=secret
64+
echo OS_PROJECT_ID=$(openstack --os-cloud=devstack-admin project show admin -f value -c id)
65+
echo OS_PROJECT_NAME=admin
66+
echo OS_RESIZE_FLAVOR=c1
67+
echo OS_FLAVOR=1
68+
echo OS_DOMAIN_ID=default
69+
} >> "$GITHUB_ENV"
70+
- name: Execute integration tests
71+
run: php ./tests/integration/run.php -s=Images
72+
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Run Networking Integration Tests
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
paths:
6+
- '**Networking**'
7+
- '**Common**'
8+
9+
jobs:
10+
tests:
11+
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
openstack_version: [ "stable/zed" ]
16+
php_version: [ 8.1 ]
17+
ubuntu_version: [ 20.04 ]
18+
runs-on: ubuntu-${{ matrix.ubuntu_version }}
19+
name: Deploy OpenStack ${{ matrix.name }} with Neutron and run Networking integration tests with php ${{matrix.php_version}}
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: get cache directory
23+
id: composer-cache
24+
run: |
25+
echo "::set-output name=dir::$(composer config cache-files-dir)"
26+
- uses: actions/cache@v3
27+
with:
28+
path: |
29+
~/.php_cs.cache
30+
${{ steps.composer-cache.outputs.dir }}
31+
key: ${{ runner.os }}-composer-${{ matrix.php_version }}-${{ hashFiles('**.composer.lock') }}
32+
restore-keys: |
33+
${{ runner.os }}-composer-${{ matrix.php_version }}-
34+
- uses: shivammathur/setup-php@v2
35+
with:
36+
php-version: ${{ matrix.php_version }}
37+
extensions: curl
38+
tools: composer:v2
39+
coverage: none
40+
- run: composer install --prefer-dist --no-interaction --no-progress
41+
- name: Restore devstack cache
42+
uses: actions/cache@v3
43+
with:
44+
path: |
45+
/opt/stack/*
46+
!/opt/stack/data
47+
~/devstack/
48+
key: ${{ runner.os }}-openstack-${{ matrix.openstack_version }}-${{ github.workflow }}
49+
- name: Deploy devstack
50+
uses: EmilienM/devstack-action@v0.11
51+
with:
52+
branch: ${{ matrix.openstack_version }}
53+
conf_overrides: |
54+
CINDER_ISCSI_HELPER=lioadm
55+
- name: Set env variables
56+
run: |
57+
{
58+
echo OS_AUTH_URL="$(grep -oP -m 1 "(?<=auth_url: )(.*)\$" /etc/openstack/clouds.yaml)/v3"
59+
echo OS_REGION=RegionOne
60+
echo OS_REGION_NAME=RegionOne
61+
echo OS_USER_ID=$(openstack --os-cloud=devstack-admin user show admin -f value -c id)
62+
echo OS_USERNAME=admin
63+
echo OS_PASSWORD=secret
64+
echo OS_PROJECT_ID=$(openstack --os-cloud=devstack-admin project show admin -f value -c id)
65+
echo OS_PROJECT_NAME=admin
66+
echo OS_RESIZE_FLAVOR=c1
67+
echo OS_FLAVOR=1
68+
echo OS_DOMAIN_ID=default
69+
} >> "$GITHUB_ENV"
70+
- name: Execute integration tests
71+
run: php ./tests/integration/run.php -s=Networking
72+

.github/workflows/integration_object_storage.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
name: Run Object Storage Integration Tests
22
on:
3+
workflow_dispatch:
34
pull_request:
45
paths:
56
- '**ObjectStore**'
7+
- '**Common**'
8+
69
jobs:
710
tests:
811
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
@@ -65,7 +68,7 @@ jobs:
6568
echo OS_PASSWORD=secret
6669
echo OS_PROJECT_ID=$(openstack --os-cloud=devstack-admin project show admin -f value -c id)
6770
echo OS_PROJECT_NAME=admin
68-
echo OS_RESIZE_FLAVOR=2
71+
echo OS_RESIZE_FLAVOR=c1
6972
echo OS_FLAVOR=1
7073
echo OS_DOMAIN_ID=default
7174
} >> "$GITHUB_ENV"

tests/integration/BlockStorage/v2/CoreTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ public function volumes()
6868
require_once $this->sampleFile($replacements, 'volumes/get.php');
6969
self::assertInstanceOf(Volume::class, $volume);
7070

71-
$replacements += ['{newName}' => $this->randomStr(), '{newDescription}' => $this->randomStr()];
71+
$replacements += [
72+
'{newName}' => $this->randomStr(),
73+
'{newDescription}' => $this->randomStr()
74+
];
7275

7376
$this->logStep('Updating volume');
7477
/** @var Volume $volume */
@@ -79,6 +82,8 @@ public function volumes()
7982
/** @var \Generator $volumes */
8083
require_once $this->sampleFile($replacements, 'volumes/list.php');
8184

85+
$volume->waitUntil('available');
86+
8287
$this->logStep('Deleting volume');
8388
require_once $this->sampleFile($replacements, 'volumes/delete.php');
8489

@@ -176,6 +181,8 @@ public function snapshots()
176181
$this->logStep('Updating snapshot');
177182
require_once $this->sampleFile($replacements, 'snapshots/update.php');
178183

184+
$snapshot->waitUntil('available', 60);
185+
179186
$this->logStep('Deleting snapshot');
180187
require_once $this->sampleFile($replacements, 'snapshots/delete.php');
181188
$snapshot->waitUntilDeleted();

0 commit comments

Comments
 (0)