Skip to content

Commit

Permalink
run object store integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
k0ka committed Sep 24, 2023
1 parent c21a8f0 commit b04ae9f
Show file tree
Hide file tree
Showing 250 changed files with 36 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
name: Run Object Storage Integration Tests
on:
push:
pull_request:
paths:
- '**ObjectStore**'
jobs:
tests:
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
matrix:
openstack_version: ["stable/zed"]
openstack_version: [ "stable/zed" ]
php_version: [ 8.1 ]
ubuntu_version: [20.04]
ubuntu_version: [ 20.04 ]
runs-on: ubuntu-${{ matrix.ubuntu_version }}
name: Deploy OpenStack ${{ matrix.name }} with Swift and run objectstorage integration tests with php ${{matrix.php_version}}
steps:
Expand All @@ -32,6 +33,11 @@ jobs:
tools: composer:v2
coverage: none
- run: composer install --prefer-dist --no-interaction --no-progress
- name: Restore devstack cache
uses: actions/cache@v2
with:
path: /opt/stack/
key: ${{ runner.os }}-oscache-${{ matrix.openstack_version }}
- name: Deploy devstack
uses: EmilienM/devstack-action@v0.11
with:
Expand All @@ -43,6 +49,21 @@ jobs:
[filter:versioned_writes]
allow_object_versioning = true
enabled_services: 's-account,s-container,s-object,s-proxy'
- name: execute integration tests
- 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=2
echo OS_FLAVOR=1
echo OS_DOMAIN_ID=default
} >> "$GITHUB_ENV"
- name: Execute integration tests
run: php ./tests/integration/run.php -s=ObjectStore

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions tests/integration/Compute/v2/CoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private function searchImages($name)
}
}

protected function setUp()
protected function setUp(): void
{
$this->network = $this->getNetworkService()->createNetwork(
[
Expand Down Expand Up @@ -498,7 +498,7 @@ private function createServerImage()
];

/** @var $server \OpenStack\Compute\v2\Models\Server */
require_once $this->sampleFile($replacements, 'images/create_server_image.php');
require_once $this->sampleFile($replacements, 'Images/create_server_image.php');

$server->waitWithCallback(function (Server $server) {
return !$server->taskState;
Expand All @@ -511,7 +511,7 @@ private function createServerImage()

private function listImages()
{
require_once $this->sampleFile([], 'images/list_images.php');
require_once $this->sampleFile([], 'Images/list_images.php');

$this->logStep('Listed all available images');
}
Expand All @@ -520,7 +520,7 @@ private function getImage()
{
$replacements = ['{imageId}' => $this->imageId];

require_once $this->sampleFile($replacements, 'images/get_image.php');
require_once $this->sampleFile($replacements, 'Images/get_image.php');

$this->logStep('Retrieved details for image {imageId}', $replacements);
}
Expand All @@ -530,20 +530,20 @@ private function imageMetadata()
$replacements = ['{imageId}' => $this->imageId];

/** @var $image \OpenStack\Compute\v2\Models\Image */
require_once $this->sampleFile($replacements, 'images/reset_image_metadata.php');
require_once $this->sampleFile($replacements, 'Images/reset_image_metadata.php');
$this->logStep('Reset metadata of image {imageId}', $replacements);

require_once $this->sampleFile($replacements, 'images/retrieve_image_metadata.php');
require_once $this->sampleFile($replacements, 'Images/retrieve_image_metadata.php');
$this->logStep('Retrieved metadata of image {imageId}', $replacements);

require_once $this->sampleFile($replacements + ['{metadataKey}'], 'images/delete_image_metadata_item.php');
require_once $this->sampleFile($replacements + ['{metadataKey}'], 'Images/delete_image_metadata_item.php');
$this->logStep('Deleted metadata key of image {imageId}', $replacements);
}

private function deleteServerImage()
{
$replacements = ['{imageId}' => $this->imageId];
require_once $this->sampleFile($replacements, 'images/delete_image.php');
require_once $this->sampleFile($replacements, 'Images/delete_image.php');
$this->logStep('Deleted image {imageId}', $replacements);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/integration/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ private function assembleTestFiles()
foreach ($this->traverse($versionPath->getPathname()) as $testPath) {
if (strpos($testPath->getFilename(), 'Test.php')) {
$testBn = strtolower(substr($testPath->getBasename(), 0, -8));
$this->tests[strtolower($serviceBn)][strtolower($versionBn)][] = $testBn;
$this->tests[$serviceBn][strtolower($versionBn)][] = $testBn;
}
}
}
Expand All @@ -57,7 +57,7 @@ private function getOpts()
break;
}
}
return strtolower($value);
return $value;
};

return [
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct(LoggerInterface $logger, SampleManagerInterface $sam
$this->sampleManager = $sampleManager;
}

public function teardown()
public function teardown(): void
{
$this->sampleManager->deletePaths();
}
Expand Down

0 comments on commit b04ae9f

Please sign in to comment.