Skip to content

Commit baa4872

Browse files
giogurto-grandek0kasmarcetjarragon-slash2peter279k
authored
Upstream sync (#12)
* GitHub workflows (php-opencloud#369) Add integration workflows for services: - BlockStorage - Compute - Images - Networking * always recheck all tests on push to master (php-opencloud#370) * Restore read the docs (php-opencloud#371) * add readthedocs.yaml * remove button * move to python 3 * Fix documentation (php-opencloud#372) * fix php-opencloud#351 * fix documentation requirements, remove unused links in docs * add badges, remove old contacts from README.md * Fix documentation (php-opencloud#373) * clarify versioning * change documentation copyright * Fix sort_key and sort_dir parameters for BlockStorage/v2/listSnapshots and Images/v2/listImages * fix list formating in documentation (php-opencloud#375) remove custom theme * added phpdocs for better type hinting (php-opencloud#376) * one integration workflow (php-opencloud#377) * one integration workflow to rule them all * update README.md with new badge * create BlockStorage v3 as copy of v2 (php-opencloud#378) * Chores (php-opencloud#379) * format via php-cs-fixer * add unit tests with the lowest possible dependencies * add unit tests with php 8.2 and 8.3 * add integration tests for 2023.1 antelope and yoga * allow skipping integration, unit or both tests in pull requests --------- Co-authored-by: k0ka <[email protected]> * Application credentials (php-opencloud#380) * add endpoints to create/get/remove application credentials * add token creation using application credentials * cancel running workflows on new commit --------- Co-authored-by: smarcet <[email protected]> Co-authored-by: k0ka <[email protected]> * fix doc for application credentials (php-opencloud#381) * Handler stack factory (php-opencloud#382) * Changed guzzle final HandlerStack extension to factory class HandlerStackFactory --------- Co-authored-by: k0ka <[email protected]> Co-authored-by: jarragon-slash2 <[email protected]> * Fix testing class namespaces (php-opencloud#383) Co-authored-by: peter279k <[email protected]> * Refactor tests (php-opencloud#384) use `include_once $this->sampleFile(` instead of `$path = $this->sampleFile(..); include_once $path` * Move integration tests to phpunit (php-opencloud#387) * moved integration tests to phpunit * updated integration tests description in CONTRIBUTING.md * added `name` parameter to `patchUser` so the sample file works properly * added `Retrievable` interface to `VolumeType` * added `HasWaiterTrait` to `Compute::Image` * added `Token::validate()` function to check if Identity token is valid --------- Co-authored-by: k0ka <[email protected]> * License: add full text, remove rackspace (php-opencloud#388) * added bigger rescue timeouts (php-opencloud#390) * return HandlerStack for BC (php-opencloud#391) * return HandlerStack for Backward Compatibility - php-opencloud#382 * Merge network services (php-opencloud#392) * Merge all network service extensions into main one using traits * Add unit test error_reporting * Increase volume attachment test timeout * Clarify docs (php-opencloud#389) * Rewrite most of documentation. * Make creating the `$openstack` object more clear. * Rename and rearrange main operations as CRUDL (Create, Read, Update, Delete, List) * Resume suspend server (php-opencloud#394) * Implement resuming and suspending of servers --------- Co-authored-by: Martin Zurowietz <[email protected]> * fix resume/suspend doc (php-opencloud#395) * refactor unit tests: use `mockRequest` for all requests (php-opencloud#397) * Fix Swift container requests with "tokens" in its name (php-opencloud#396) * add errorVerbosity (php-opencloud#400) fixes php-opencloud#335 fixes php-opencloud#398 * add docs for volume attachement (php-opencloud#401) fixes php-opencloud#399 * fix doc links (php-opencloud#402) * enchance error builder: output body only for json, limit body to 5 Kb (php-opencloud#405) fixes php-opencloud#403 supersedes php-opencloud#404 * make swift metadata header case insensitive (php-opencloud#407) * compare headers case insensitively * drop support of unmaintained releases in CI (until they are returned in github action). * return unmaintaned openstack versions into ci (php-opencloud#408) * override TARGET_BRANCH * Apply php-cs-fixer changes --------- Co-authored-by: Konstantin Babushkin <[email protected]> Co-authored-by: k0ka <[email protected]> Co-authored-by: smarcet <[email protected]> Co-authored-by: jarragon-slash2 <[email protected]> Co-authored-by: peter279k <[email protected]> Co-authored-by: Martin Zurowietz <[email protected]> Co-authored-by: Kamil Kozłowski <[email protected]> Co-authored-by: giogurto-grande <[email protected]>
1 parent f2c5293 commit baa4872

File tree

581 files changed

+9531
-7448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

581 files changed

+9531
-7448
lines changed

.gitattributes

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
/tests export-ignore
55
/.gitattributes export-ignore
66
/.gitignore export-ignore
7-
/.php_cs.dist export-ignore
7+
/.php-cs-fixer.dist.php export-ignore
8+
/.readthedocs.yaml export-ignore
89
/.scrutinizer.yml export-ignore
9-
/.travis.yml export-ignore
10+
/phpunit.sample.xml.dist export-ignore
1011
/phpunit.xml.dist export-ignore

.github/workflows/format.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: "Format"
2+
on:
3+
push:
4+
branches:
5+
- '*'
6+
7+
jobs:
8+
composer-normalize:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
ref: ${{ github.head_ref }}
14+
15+
- uses: shivammathur/setup-php@v2
16+
with:
17+
coverage: none
18+
extensions: mbstring
19+
php-version: 8.2
20+
21+
- run: composer install --no-interaction --no-progress --no-suggest
22+
23+
- run: composer normalize
24+
25+
- uses: stefanzweifel/git-auto-commit-action@v4
26+
with:
27+
commit_message: Normalize composer.json
28+
29+
php-cs-fixer:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v3
33+
with:
34+
ref: ${{ github.head_ref }}
35+
36+
- uses: shivammathur/setup-php@v2
37+
with:
38+
coverage: none
39+
extensions: mbstring
40+
php-version: 8.1
41+
42+
- run: composer install --no-interaction --no-progress --no-suggest
43+
44+
- run: vendor/bin/php-cs-fixer fix
45+
46+
- run: git pull
47+
48+
- uses: stefanzweifel/git-auto-commit-action@v4
49+
with:
50+
commit_message: Apply php-cs-fixer changes

.github/workflows/integration_identity.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.
Lines changed: 64 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,53 @@
1-
name: Run Object Storage Integration Tests
1+
name: Integration Tests
2+
23
on:
4+
workflow_dispatch:
35
pull_request:
4-
paths:
5-
- '**ObjectStore**'
6+
push:
7+
branches:
8+
- master
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
614
jobs:
715
tests:
8-
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
16+
if: |
17+
!contains(github.event.pull_request.body, 'skip ci')
18+
&& !contains(github.event.pull_request.body, 'skip integration')
919
strategy:
1020
fail-fast: false
1121
matrix:
12-
openstack_version: [ "stable/zed" ]
22+
openstack_version: [ "stable/2023.2" ]
1323
php_version: [ 8.1 ]
14-
ubuntu_version: [ 20.04 ]
24+
include:
25+
- name: "bobcat"
26+
openstack_version: "stable/2023.2"
27+
ubuntu_version: "22.04"
28+
- name: "antelope"
29+
openstack_version: "stable/2023.1"
30+
ubuntu_version: "22.04"
31+
- name: "zed"
32+
openstack_version: "stable/zed"
33+
ubuntu_version: "20.04"
34+
- name: "yoga"
35+
openstack_version: "unmaintained/yoga"
36+
ubuntu_version: "20.04"
37+
- name: "wallaby"
38+
openstack_version: "unmaintained/wallaby"
39+
ubuntu_version: "20.04"
40+
block_storage_v2: true
1541
runs-on: ubuntu-${{ matrix.ubuntu_version }}
16-
name: Deploy OpenStack ${{ matrix.name }} and run ObjectStore integration tests with php ${{matrix.php_version}}
42+
name: Deploy OpenStack ${{ matrix.name }} and run integration tests with php ${{matrix.php_version}}
1743
steps:
1844
- uses: actions/checkout@v2
45+
1946
- name: get cache directory
2047
id: composer-cache
2148
run: |
2249
echo "::set-output name=dir::$(composer config cache-files-dir)"
50+
2351
- uses: actions/cache@v3
2452
with:
2553
path: |
@@ -28,13 +56,16 @@ jobs:
2856
key: ${{ runner.os }}-composer-${{ matrix.php_version }}-${{ hashFiles('**.composer.lock') }}
2957
restore-keys: |
3058
${{ runner.os }}-composer-${{ matrix.php_version }}-
59+
3160
- uses: shivammathur/setup-php@v2
3261
with:
3362
php-version: ${{ matrix.php_version }}
3463
extensions: curl
3564
tools: composer:v2
3665
coverage: none
66+
3767
- run: composer install --prefer-dist --no-interaction --no-progress
68+
3869
- name: Restore devstack cache
3970
uses: actions/cache@v3
4071
with:
@@ -43,17 +74,21 @@ jobs:
4374
!/opt/stack/data
4475
~/devstack/
4576
key: ${{ runner.os }}-openstack-${{ matrix.openstack_version }}-${{ github.workflow }}
77+
4678
- name: Deploy devstack
47-
uses: EmilienM/devstack-action@v0.11
79+
uses: EmilienM/devstack-action@v0.15
4880
with:
4981
branch: ${{ matrix.openstack_version }}
5082
conf_overrides: |
83+
CINDER_ISCSI_HELPER=lioadm
5184
SWIFT_ENABLE_TEMPURLS=True
5285
SWIFT_TEMPURL_KEY=secretkey
86+
TARGET_BRANCH=${{ matrix.openstack_version }}
5387
[[post-config|\$SWIFT_CONFIG_PROXY_SERVER]]
5488
[filter:versioned_writes]
5589
allow_object_versioning = true
56-
enabled_services: 's-account,s-container,s-object,s-proxy'
90+
enabled_services: 's-account,s-container,s-object,s-proxy,s-bak'
91+
5792
- name: Set env variables
5893
run: |
5994
{
@@ -65,10 +100,27 @@ jobs:
65100
echo OS_PASSWORD=secret
66101
echo OS_PROJECT_ID=$(openstack --os-cloud=devstack-admin project show admin -f value -c id)
67102
echo OS_PROJECT_NAME=admin
68-
echo OS_RESIZE_FLAVOR=2
103+
echo OS_RESIZE_FLAVOR=c1
69104
echo OS_FLAVOR=1
70105
echo OS_DOMAIN_ID=default
71106
} >> "$GITHUB_ENV"
72-
- name: Execute integration tests
73-
run: php ./tests/integration/run.php -s=ObjectStore
74107
108+
- name: Check if Block Storage API v2 must be tested
109+
if: matrix.block_storage_v2 == true
110+
run: echo "OS_BLOCK_STORAGE_V2=1" >> "$GITHUB_ENV"
111+
112+
- name: Execute Integration tests via PhpUnit
113+
run: vendor/bin/phpunit --configuration ./phpunit.sample.xml.dist
114+
115+
- name: Collect logs
116+
if: ${{ failure() }}
117+
run: |
118+
set -x
119+
journalctl >failure-logs
120+
121+
- name: Save logs
122+
if: ${{ failure() }}
123+
uses: actions/upload-artifact@v3
124+
with:
125+
name: failure-logs
126+
path: failure-logs

.github/workflows/unit_tests.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,57 @@
1-
name: Run Unit Tests
1+
name: Unit Tests
22
on:
3+
workflow_dispatch:
34
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
413
jobs:
514
tests:
615
runs-on: ubuntu-22.04
7-
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
16+
if: |
17+
!contains(github.event.pull_request.body, 'skip ci')
18+
&& !contains(github.event.pull_request.body, 'skip unit')
819
strategy:
920
fail-fast: false
1021
matrix:
11-
php: [ 7.2, 7.3, 7.4, 8.0, 8.1 ]
12-
name: "php-${{ matrix.php }}"
22+
php: [ 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3 ]
23+
composer:
24+
- name: lowest
25+
arg: "--prefer-lowest --prefer-stable"
26+
- name: highest
27+
arg: "" # No args added as highest is default
28+
name: PHPUnit on PHP ${{ matrix.php }} with ${{ matrix.composer.name }} dependencies
1329
steps:
1430
- uses: actions/checkout@v2
31+
1532
- name: get cache directory
1633
id: composer-cache
1734
run: |
1835
echo "::set-output name=dir::$(composer config cache-files-dir)"
36+
1937
- uses: actions/cache@v2
2038
with:
2139
path: |
2240
~/.php_cs.cache
2341
${{ steps.composer-cache.outputs.dir }}
24-
key: ${{ runner.os }}-cache-${{ matrix.php }}-${{ hashFiles('**.composer.lock') }}
42+
key: ${{ runner.os }}-cache-${{ matrix.php }}-${{ matrix.composer.name }}-${{ hashFiles('**.composer.lock') }}
43+
2544
- uses: shivammathur/setup-php@v2
2645
with:
2746
php-version: ${{ matrix.php }}
2847
extensions: curl
2948
tools: composer:v2
3049
coverage: none
31-
- run: composer install --prefer-dist --no-interaction --no-progress
50+
51+
- run: composer update --prefer-dist --no-interaction --no-progress ${{ matrix.composer.arg }}
52+
3253
- run: vendor/bin/parallel-lint --exclude vendor .
54+
3355
- name: execute unit tests
3456
run: vendor/bin/phpunit --configuration phpunit.xml.dist
3557

.php_cs.dist renamed to .php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
exit(0);
55
}
66

7-
return PhpCsFixer\Config::create()
7+
return (new PhpCsFixer\Config())
88
->setRules(
99
[
1010
'@PSR2' => true,

.readthedocs.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Read the Docs configuration file for Sphinx projects
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version and other tools you might need
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.12"
12+
13+
# Build documentation in the "doc/" directory with Sphinx
14+
sphinx:
15+
configuration: doc/conf.py
16+
17+
# Optional but recommended, declare the Python requirements required
18+
# to build your documentation
19+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
20+
python:
21+
install:
22+
- requirements: doc/requirements.txt

0 commit comments

Comments
 (0)