Skip to content

Commit edb5b5b

Browse files
Try installing and running the s3ver locally
1 parent 9e835f4 commit edb5b5b

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

.github/workflows/build-and-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@ jobs:
101101
if: matrix.options.os != 'windows-latest'
102102
shell: bash
103103
run: |
104-
sudo npm install -g s3rver
105-
sudo s3rver -d . &
104+
sudo npm install s3rver
105+
sudo npx s3rver -d . &
106106
107107
- name: S3rver Setup Windows
108108
if: matrix.options.os == 'windows-latest'
109109
shell: bash
110110
run: |
111-
npm install -g s3rver
112-
s3rver -d . &
111+
npm install s3rver
112+
npx s3rver -d . &
113113
114114
- name: DotNet Setup
115115
uses: actions/setup-dotnet@v3

src/ImageSharp.Web.Providers.AWS/AmazonS3ClientFactory.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ internal static class AmazonS3ClientFactory
1818
/// <returns>
1919
/// A new <see cref="AmazonS3Client"/>.
2020
/// </returns>
21+
/// <exception cref="ArgumentException">Invalid configuration.</exception>
2122
public static AmazonS3Client CreateClient(IAWSS3BucketClientOptions options)
2223
{
2324
if (!string.IsNullOrWhiteSpace(options.Endpoint))
@@ -33,14 +34,14 @@ public static AmazonS3Client CreateClient(IAWSS3BucketClientOptions options)
3334
{
3435
// AccessSecret can be empty.
3536
Guard.NotNullOrWhiteSpace(options.Region, nameof(options.Region));
36-
var region = RegionEndpoint.GetBySystemName(options.Region);
37+
RegionEndpoint region = RegionEndpoint.GetBySystemName(options.Region);
3738
AmazonS3Config config = new() { RegionEndpoint = region, UseAccelerateEndpoint = options.UseAccelerateEndpoint };
3839
SetTimeout(config, options.Timeout);
3940
return new AmazonS3Client(options.AccessKey, options.AccessSecret, config);
4041
}
4142
else if (!string.IsNullOrWhiteSpace(options.Region))
4243
{
43-
var region = RegionEndpoint.GetBySystemName(options.Region);
44+
RegionEndpoint region = RegionEndpoint.GetBySystemName(options.Region);
4445
AmazonS3Config config = new() { RegionEndpoint = region, UseAccelerateEndpoint = options.UseAccelerateEndpoint };
4546
SetTimeout(config, options.Timeout);
4647
return new AmazonS3Client(config);

tests/ImageSharp.Web.Tests/TestUtilities/AWSS3StorageImageProviderFactory.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private static async Task InitializeAWSStorageAsync(IServiceProvider services, A
4444
{
4545
try
4646
{
47-
var putBucketRequest = new PutBucketRequest
47+
PutBucketRequest putBucketRequest = new()
4848
{
4949
BucketName = bucketOptions.BucketName,
5050
BucketRegion = bucketOptions.Region,
@@ -57,7 +57,7 @@ private static async Task InitializeAWSStorageAsync(IServiceProvider services, A
5757
{
5858
// CI tests are run in parallel and can sometimes return a
5959
// false negative for the existance of a bucket.
60-
if (string.Equals(e.ErrorCode, "BucketAlreadyExists"))
60+
if (string.Equals(e.ErrorCode, "BucketAlreadyExists", StringComparison.Ordinal))
6161
{
6262
return;
6363
}
@@ -84,14 +84,14 @@ private static async Task InitializeAWSStorageAsync(IServiceProvider services, A
8484
using Stream stream = file.CreateReadStream();
8585

8686
// Set the max-age property so we get coverage for testing in our AWS provider.
87-
var cacheControl = new CacheControlHeaderValue
87+
CacheControlHeaderValue cacheControl = new()
8888
{
8989
Public = true,
9090
MaxAge = TimeSpan.FromDays(7),
9191
MustRevalidate = true
9292
};
9393

94-
var putRequest = new PutObjectRequest()
94+
PutObjectRequest putRequest = new()
9595
{
9696
BucketName = bucketOptions.BucketName,
9797
Key = TestConstants.ImagePath,

tests/ImageSharp.Web.Tests/TestUtilities/TestServerFixture.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ public abstract class TestServerFixture : IDisposable
2121
private TestServer server;
2222
private bool isDisposed;
2323

24-
#pragma warning disable RCS1160 // Abstract type should not have public constructors.
25-
public TestServerFixture()
26-
#pragma warning restore RCS1160 // Abstract type should not have public constructors.
24+
protected TestServerFixture()
2725
{
2826
IConfigurationRoot configuration = new ConfigurationBuilder()
2927
.AddInMemoryCollection(new[]

0 commit comments

Comments
 (0)