Skip to content

Commit

Permalink
Merge branch 'master' into feature/catalog_overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
k0ka authored Jan 7, 2024
2 parents db12e22 + aeb5012 commit fccbf8d
Show file tree
Hide file tree
Showing 441 changed files with 1,950 additions and 2,291 deletions.
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/.github export-ignore
/doc export-ignore
/samples export-ignore
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs.dist export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
50 changes: 50 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "Format"
on:
push:
branches:
- '*'

jobs:
composer-normalize:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- uses: shivammathur/setup-php@v2
with:
coverage: none
extensions: mbstring
php-version: 8.2

- run: composer install --no-interaction --no-progress --no-suggest

- run: composer normalize

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Normalize composer.json

php-cs-fixer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- uses: shivammathur/setup-php@v2
with:
coverage: none
extensions: mbstring
php-version: 8.1

- run: composer install --no-interaction --no-progress --no-suggest

- run: vendor/bin/php-cs-fixer fix

- run: git pull

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply php-cs-fixer changes
114 changes: 114 additions & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Integration Tests

on:
workflow_dispatch:
pull_request:
push:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
tests:
if: |
!contains(github.event.pull_request.body, 'skip ci')
&& !contains(github.event.pull_request.body, 'skip integration')
strategy:
fail-fast: false
matrix:
openstack_version: [ "stable/wallaby", "stable/zed", "stable/2023.2" ]
php_version: [ 8.1 ]
include:
- name: "bobcat"
openstack_version: "stable/2023.2"
ubuntu_version: "22.04"
- name: "antelope"
openstack_version: "stable/2023.1"
ubuntu_version: "22.04"
- name: "zed"
openstack_version: "stable/zed"
ubuntu_version: "20.04"
- name: "yoga"
openstack_version: "stable/yoga"
ubuntu_version: "20.04"
- name: "wallaby"
openstack_version: "stable/wallaby"
ubuntu_version: "20.04"
block_storage_v2: true
runs-on: ubuntu-${{ matrix.ubuntu_version }}
name: Deploy OpenStack ${{ matrix.name }} and run integration tests with php ${{matrix.php_version}}
steps:
- uses: actions/checkout@v2
- name: get cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v3
with:
path: |
~/.php_cs.cache
${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php_version }}-${{ hashFiles('**.composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php_version }}-
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: curl
tools: composer:v2
coverage: none
- run: composer install --prefer-dist --no-interaction --no-progress
- name: Restore devstack cache
uses: actions/cache@v3
with:
path: |
/opt/stack/*
!/opt/stack/data
~/devstack/
key: ${{ runner.os }}-openstack-${{ matrix.openstack_version }}-${{ github.workflow }}
- name: Deploy devstack
uses: EmilienM/[email protected]
with:
branch: ${{ matrix.openstack_version }}
conf_overrides: |
CINDER_ISCSI_HELPER=lioadm
SWIFT_ENABLE_TEMPURLS=True
SWIFT_TEMPURL_KEY=secretkey
[[post-config|\$SWIFT_CONFIG_PROXY_SERVER]]
[filter:versioned_writes]
allow_object_versioning = true
enabled_services: 's-account,s-container,s-object,s-proxy,s-bak'
- name: Set env variables
run: |
{
echo OS_AUTH_URL="$(grep -oP -m 1 "(?<=auth_url: )(.*)\$" /etc/openstack/clouds.yaml)/v3"
echo OS_REGION=RegionOne
echo OS_REGION_NAME=RegionOne
echo OS_USER_ID=$(openstack --os-cloud=devstack-admin user show admin -f value -c id)
echo OS_USERNAME=admin
echo OS_PASSWORD=secret
echo OS_PROJECT_ID=$(openstack --os-cloud=devstack-admin project show admin -f value -c id)
echo OS_PROJECT_NAME=admin
echo OS_RESIZE_FLAVOR=c1
echo OS_FLAVOR=1
echo OS_DOMAIN_ID=default
} >> "$GITHUB_ENV"
- name: Execute Block Storage v2 tests
if: matrix.block_storage_v2 == true
run: php ./tests/integration/run.php -s=BlockStorage -v=v2
- name: Execute Block Storage v3 tests
run: php ./tests/integration/run.php -s=BlockStorage -v=v3
- name: Execute Compute tests
run: php ./tests/integration/run.php -s=Compute
- name: Execute Identity tests
run: php ./tests/integration/run.php -s=Identity
- name: Execute Images tests
run: php ./tests/integration/run.php -s=Images
- name: Execute Networking tests
run: php ./tests/integration/run.php -s=Networking
- name: Execute Object Storage tests
run: php ./tests/integration/run.php -s=ObjectStore

57 changes: 57 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Unit Tests
on:
workflow_dispatch:
pull_request:
push:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-22.04
if: |
!contains(github.event.pull_request.body, 'skip ci')
&& !contains(github.event.pull_request.body, 'skip unit')
strategy:
fail-fast: false
matrix:
php: [ 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3 ]
composer:
- name: lowest
arg: "--prefer-lowest --prefer-stable"
- name: highest
arg: "" # No args added as highest is default
name: PHPUnit on PHP ${{ matrix.php }} with ${{ matrix.composer.name }} dependencies
steps:
- uses: actions/checkout@v2

- name: get cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: |
~/.php_cs.cache
${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-cache-${{ matrix.php }}-${{ matrix.composer.name }}-${{ hashFiles('**.composer.lock') }}

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl
tools: composer:v2
coverage: none

- run: composer update --prefer-dist --no-interaction --no-progress ${{ matrix.composer.arg }}

- run: vendor/bin/parallel-lint --exclude vendor .

- name: execute unit tests
run: vendor/bin/phpunit --configuration phpunit.xml.dist

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ coverage/
vendor/
*.pyc
phpunit.xml
.phpunit.result.cache
coverage.xml
composer.lock
env_test.sh
2 changes: 1 addition & 1 deletion .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
exit(0);
}

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRules(
[
'@PSR2' => true,
Expand Down
22 changes: 22 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"

# Build documentation in the "doc/" directory with Sphinx
sphinx:
configuration: doc/conf.py

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: doc/requirements.txt
37 changes: 20 additions & 17 deletions COVERAGE.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
# OpenStack versions coverage

While we strive to support all versions of OpenStack, we can only test limited number of versions. The current set:
* 2023.2 Bobcat
* 2023.1 Antelope
* Zed
* Yoga
* Wallaby - as the latest version which had BlockStorage v2 API

# OpenStack services coverage

|Name|PHP classes|API definition|Unit tests|Sample files|Integration tests|Documentation|
|---|:--:|:--:|:--:|:--:|:--:|:--:|
|Block Storage v2|&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|
|Compute v2|&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|
|Compute v2 exts|||||||
|Data Processing v1|||||||
|Database v1|||||||
|Identity v2|&#10003;|&#10003;|&#10003;||||
|Identity v2 exts|||||||
|Identity v3|&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|
|Identity v3 exts|||||||
|Images v2|&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|
|Networking v2|&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|
|Networking v2 exts|||||||
|Object Storage v1|&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|
|Orchestration v1|||||||
|Telemetry v2|||||||
| Name |PHP classes|API definition|Unit tests|Sample files|Integration tests|Documentation|
|--------------------|:--:|:--:|:--:|:--:|:--:|:--:|
| Block Storage v2 |&#10003;|&#10003;|&#10003;||&#10003;||
| Block Storage v3 |&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|
| Compute v2 |&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|
| Identity v2 |&#10003;|&#10003;|&#10003;||||
| Identity v3 |&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|
| Images v2 |&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|
| Networking v2 |&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|
| Object Storage v1 |&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|&#10003;|

## Key

Expand Down Expand Up @@ -54,3 +56,4 @@ In order for this to be marked complete, every public operation needs to be docu
have all their keys defined. All types must be defined. Any required options must be marked.
* a human-readable description
* a code sample

Loading

0 comments on commit fccbf8d

Please sign in to comment.