Skip to content

Commit

Permalink
Merge #3
Browse files Browse the repository at this point in the history
3: Support FilePathsBase 0.9 r=mattBrzezinski a=fchorney



Co-authored-by: Fernando Chorney <fernando.chorney@invenia.ca>
  • Loading branch information
bors[bot] and fchorney authored Dec 17, 2020
2 parents de7c295 + e6232b6 commit 20c9c4b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "AWSTools"
uuid = "83bcdc74-1232-581c-948a-f29122bf8259"
authors = ["Invenia Technical Computing"]
version = "1.7.4"
version = "1.8.0"

[deps]
AWSCore = "4f1ea46c-232b-54a6-9b17-cc2d0f3e6598"
Expand All @@ -22,7 +22,7 @@ XMLDict = "228000da-037f-5747-90a9-8195ccbf91a5"
AWSCore = "0.5, 0.6"
AWSS3 = "0.6"
EzXML = "0.7.3, 0.8, 0.9, 1"
FilePathsBase = "0.6, 0.7, 0.8"
FilePathsBase = "0.6, 0.7, 0.8, 0.9"
HTTP = "0.8.4"
MbedTLS = "0.6, 0.7, 1"
Memento = "0.12.1, 0.13, 1"
Expand Down
20 changes: 10 additions & 10 deletions test/S3.jl
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ end

try
@testset "Upload to S3" begin
dest = Path("$s3_prefix/folder3/testfile")
dest = S3Path("$s3_prefix/folder3/testfile")

try
mktemp() do src, stream
Expand All @@ -247,7 +247,7 @@ end
end

@testset "Download from S3" begin
src = Path("$s3_prefix/folder4/testfile")
src = S3Path("$s3_prefix/folder4/testfile")

try
s3_put(src.bucket, src.key, "Remote content")
Expand Down Expand Up @@ -283,7 +283,7 @@ end
end

@testset "Download via presign" begin
src = Path("$s3_prefix/presign/file")
src = S3Path("$s3_prefix/presign/file")
content = "presigned content"
s3_put(src.bucket, src.key, content)

Expand Down Expand Up @@ -312,8 +312,8 @@ end
@testset "Sync S3 directories" begin
bucket, key_prefix = bucket_and_key(s3_prefix)

src_dir = Path("$s3_prefix/folder1/")
dest_dir = Path("$s3_prefix/folder2/")
src_dir = S3Path("$s3_prefix/folder1/")
dest_dir = S3Path("$s3_prefix/folder2/")

# Directories should be empty, but just in case
# delete any pre-existing objects in the s3 bucket directories
Expand Down Expand Up @@ -374,12 +374,12 @@ end

# Test readdir only lists files and "dirs" within this S3 "dir"
@test readdir(dest_dir) == ["file1", "file2", "folder/"]
@test readdir(Path("$s3_prefix/")) == [
@test readdir(S3Path("$s3_prefix/")) == [
"folder1/", "folder2/", "presign/"
]
# Not including the ending `/` means this refers to an object and
# not a directory prefix in S3
@test_throws ArgumentError readdir(Path(s3_prefix))
@test_throws ArgumentError readdir(S3Path(s3_prefix))

@testset "Sync modified dest file" begin
# Modify a file in dest
Expand Down Expand Up @@ -441,7 +441,7 @@ end
file = "s3://" * join([obj["Bucket"], obj["Key"]], '/')

@test startswith(file, "s3://")
@test_throws ArgumentError sync(Path(file), dest_dir)
@test_throws ArgumentError sync(S3Path(file), dest_dir)
end

rm(src_files[1])
Expand Down Expand Up @@ -502,14 +502,14 @@ end

finally
# Clean up any files left in the test directory
rm(Path("$s3_prefix/"); recursive=true)
rm(S3Path("$s3_prefix/"); recursive=true)

# Delete bucket if it was explicitly created
if TEST_BUCKET_AND_PREFIX === nothing
s3_bucket_dir = replace(s3_prefix, r"^(s3://[^/]+).*$" => s"\1")
bucket, key = bucket_and_key(s3_bucket_dir)
@info "Deleting S3 bucket $bucket"
rm(Path("s3://$bucket/"); recursive=true)
rm(S3Path("s3://$bucket/"); recursive=true)
s3_delete_bucket(bucket)
end
end
Expand Down
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ using AWSCore: AWSCredentials, AWSException, aws_config
using AWSTools
using Dates
using Documenter
using FilePathsBase
using FilePathsBase: join
using HTTP
using Memento
using Mocking
Expand Down

2 comments on commit 20c9c4b

@mattBrzezinski
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/29805

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.8.0 -m "<description of version>" 20c9c4bddefac18ae68fb8ecdb5f2dad28e0edee
git push origin v1.8.0

Please sign in to comment.