Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update image used in CI-tests from ubuntu:18.04 to ubuntu:22.04 to avoid deprecation problems #2526

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changes/nextrelease/ci-image-update
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"type": "enhancement",
"category": "",
"description": "Update the image used in CI-jobs from ubuntu-18.04 to ubuntu-22.04."
}
]
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ permissions:

jobs:
run:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
strategy:
#for each of the following versions of PHP, with and without --prefer-lowest
matrix:
php-versions: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
composer-options: ['', '--prefer-lowest']

#set the name for each job
name: PHP ${{ matrix.php-versions }} ${{ matrix.composer-options }}
#set up environment variables used by unit tests
Expand Down
9 changes: 8 additions & 1 deletion tests/CloudFront/SignerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ public function testBadPrivateKeyContents() {
* Assert that the key file is parsed during construction
*/
public function testBadPrivateKeyPath() {
$this->expectExceptionMessageMatches("/PEM .*no start line/");
preg_match('/OpenSSL (?<version>\d+\.\d+\.\d+)/',OPENSSL_VERSION_TEXT,$matches);
// OpenSSL 1.* and 3.* do not return the same error-message
if (isset($matches['version']) && version_compare($matches['version'],'3.0','>=')) {
$this->expectExceptionMessageMatches("/error:1E08010C:DECODER routines::unsupported/");
} else {
$this->expectExceptionMessageMatches("/PEM .*no start line/");
}

$this->expectException(\InvalidArgumentException::class);
$filename = tempnam(sys_get_temp_dir(), 'cloudfront-fake-key');
file_put_contents($filename, "Not a real private key");
Expand Down
12 changes: 10 additions & 2 deletions tests/Crypto/Polyfill/AesGcmTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2644,8 +2644,16 @@ public function testCompat()
$aad,
$tag2
);
$this->assertSame(bin2hex($exp), bin2hex($got));
$this->assertSame(bin2hex($tag1), bin2hex($tag2));

$failureMessage = sprintf("Failed with parameters:\n\tplaintext: %s\n\taad: %s\n\tkey: %s\n\tnonce: %s",
bin2hex($plaintext),
bin2hex($aad),
bin2hex($key),
bin2hex($nonce)
);

$this->assertSame(bin2hex($exp), bin2hex($got),$failureMessage);
$this->assertSame(bin2hex($tag1), bin2hex($tag2),$failureMessage);
}
}
}