Skip to content

Commit

Permalink
Merge pull request #9 from invenia/mr/drop-0.6
Browse files Browse the repository at this point in the history
Drop Julia 0.6
  • Loading branch information
mjram0s authored Apr 12, 2019
2 parents 29986bc + a3bf0be commit 0323eee
Show file tree
Hide file tree
Showing 13 changed files with 308 additions and 57 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
*.jl.mem
/docs/build/
/docs/site/
/Manifest.toml
24 changes: 10 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ os:
- linux
- osx
julia:
- 0.6
- 0.7
- 1.0
- 1.1
- nightly
matrix:
allow_failures:
Expand All @@ -15,15 +14,12 @@ matrix:
notifications:
email: false
after_success:
- |
julia -e '
VERSION >= v"0.7.0-DEV.3656" && import Pkg
VERSION >= v"0.7.0-DEV.5183" || cd(Pkg.dir("CloudWatchLogs"))
Pkg.add("Coverage"); using Coverage
Codecov.submit(process_folder())'
- |
julia -e '
VERSION >= v"0.7.0-DEV.3656" && import Pkg
Pkg.add("Documenter")
VERSION >= v"0.7.0-DEV.5183" || cd(Pkg.dir("CloudWatchLogs"))
include(joinpath("docs", "make.jl"))'
- julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'
jobs:
include:
- stage: "Documentation"
julia: 1.0
script:
- julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- julia --project=docs/ docs/make.jl
after_success: skip
27 changes: 27 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name = "CloudWatchLogs"
uuid = "c4c1e6a2-6bdd-52e0-b56d-1d4734724d2d"

[deps]
AWSCore = "4f1ea46c-232b-54a6-9b17-cc2d0f3e6598"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
MbedTLS = "739be429-bea8-5141-9913-cc70e7f3736d"
Memento = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9"
Mocking = "78c3b35d-d492-501b-9361-3d52fe80e533"
TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[compat]
AWSCore = ">= 0.3.0"
Memento = ">= 0.9.0"
Mocking = ">= 0.5.3"
TimeZones = ">= 0.5.0"
julia = "0.7, 1.0"

[extras]
EzXML = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["EzXML", "HTTP", "Printf", "Test"]
5 changes: 2 additions & 3 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
julia 0.6
julia 0.7
AWSCore 0.3
MbedTLS
Memento 0.9
Mocking 0.5.3
TimeZones 0.5
Compat 0.54
MbedTLS
224 changes: 224 additions & 0 deletions docs/Manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
[[AWSCore]]
deps = ["Base64", "DataStructures", "Dates", "HTTP", "IniFile", "JSON", "LazyJSON", "MbedTLS", "Retry", "Sockets", "SymDict", "Test", "XMLDict"]
git-tree-sha1 = "d9b2ada3bf289c504f765fec863cacea5aeb0541"
uuid = "4f1ea46c-232b-54a6-9b17-cc2d0f3e6598"
version = "0.6.0"

[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[BinaryProvider]]
deps = ["Libdl", "Pkg", "SHA", "Test"]
git-tree-sha1 = "055eb2690182ebc31087859c3dd8598371d3ef9e"
uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
version = "0.5.3"

[[CloudWatchLogs]]
deps = ["AWSCore", "Dates", "MbedTLS", "Memento", "Mocking", "TimeZones", "UUIDs"]
path = ".."
uuid = "c4c1e6a2-6bdd-52e0-b56d-1d4734724d2d"
version = "0.2.1+"

[[Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "84aa74986c5b9b898b0d1acaf3258741ee64754f"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "2.1.0"

[[DataStructures]]
deps = ["InteractiveUtils", "OrderedCollections", "Random", "Serialization", "Test"]
git-tree-sha1 = "ca971f03e146cf144a9e2f2ce59674f5bf0e8038"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.15.0"

[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[DelimitedFiles]]
deps = ["Mmap"]
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"

[[Distributed]]
deps = ["LinearAlgebra", "Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[DocStringExtensions]]
deps = ["LibGit2", "Markdown", "Pkg", "Test"]
git-tree-sha1 = "4d30e889c9f106a51ffa4791a88ffd4765bf20c3"
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.7.0"

[[Documenter]]
deps = ["Base64", "DocStringExtensions", "InteractiveUtils", "LibGit2", "Logging", "Markdown", "Pkg", "REPL", "Random", "Test", "Unicode"]
git-tree-sha1 = "a8c41ba3d0861240dbec942ee1d0f86c57c37c1c"
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
version = "0.21.5"

[[EzXML]]
deps = ["BinaryProvider", "Libdl", "Pkg", "Printf", "Test"]
git-tree-sha1 = "ad00b79cca4bb3eabb4209217859c553af4401f5"
uuid = "8f5d6c58-4d21-5cfd-889c-e3ad7ee6a615"
version = "0.9.1"

[[HTTP]]
deps = ["Base64", "Dates", "Distributed", "IniFile", "MbedTLS", "Random", "Sockets", "Test"]
git-tree-sha1 = "25db0e3f27bd5715814ca7e4ad22025fdcf5cc6e"
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
version = "0.8.0"

[[IniFile]]
deps = ["Test"]
git-tree-sha1 = "098e4d2c533924c921f9f9847274f2ad89e018b8"
uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f"
version = "0.5.0"

[[InteractiveUtils]]
deps = ["LinearAlgebra", "Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[IterTools]]
deps = ["SparseArrays", "Test"]
git-tree-sha1 = "79246285c43602384e6f1943b3554042a3712056"
uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
version = "1.1.1"

[[JSON]]
deps = ["Dates", "Distributed", "Mmap", "Sockets", "Test", "Unicode"]
git-tree-sha1 = "1f7a25b53ec67f5e9422f1f551ee216503f4a0fa"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "0.20.0"

[[LazyJSON]]
deps = ["DataStructures", "JSON", "Mmap", "Test"]
git-tree-sha1 = "c02f54c69bf8d7ef39906608d1fc5011d1670e9c"
uuid = "fc18253b-5e1b-504c-a4a2-9ece4944c004"
version = "0.1.1"

[[LibGit2]]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"

[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[[LinearAlgebra]]
deps = ["Libdl"]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[MbedTLS]]
deps = ["BinaryProvider", "Dates", "Distributed", "Libdl", "Random", "Sockets", "Test"]
git-tree-sha1 = "2d94286a9c2f52c63a16146bb86fd6cdfbf677c6"
uuid = "739be429-bea8-5141-9913-cc70e7f3736d"
version = "0.6.8"

[[Memento]]
deps = ["Dates", "Distributed", "JSON", "Sockets", "Syslogs", "Test", "TimeZones", "UUIDs"]
git-tree-sha1 = "56c5ac9c3e89634ab5f1e736a9c3ef075b3e5850"
uuid = "f28f55f0-a522-5efc-85c2-fe41dfb9b2d9"
version = "0.11.0"

[[Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"

[[Mocking]]
deps = ["Compat", "Dates"]
git-tree-sha1 = "4bf69aaf823b119b034e091e16b18311aa191663"
uuid = "78c3b35d-d492-501b-9361-3d52fe80e533"
version = "0.5.7"

[[Nullables]]
deps = ["Compat"]
git-tree-sha1 = "ae1a63457e14554df2159b0b028f48536125092d"
uuid = "4d1e1d77-625e-5b40-9113-a560ec7a8ecd"
version = "0.0.8"

[[OrderedCollections]]
deps = ["Random", "Serialization", "Test"]
git-tree-sha1 = "85619a3f3e17bb4761fe1b1fd47f0e979f964d5b"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
version = "1.0.2"

[[Pkg]]
deps = ["Dates", "LibGit2", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[[Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"

[[Random]]
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[Retry]]
deps = ["Test"]
git-tree-sha1 = "56bfdfca33e70883e96fd398548ebd4d405b41fe"
uuid = "20febd7b-183b-5ae2-ac4a-720e7ce64774"
version = "0.4.0"

[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"

[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[SharedArrays]]
deps = ["Distributed", "Mmap", "Random", "Serialization"]
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"

[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[SparseArrays]]
deps = ["LinearAlgebra", "Random"]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[[Statistics]]
deps = ["LinearAlgebra", "SparseArrays"]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[[SymDict]]
deps = ["Test"]
git-tree-sha1 = "0108ccdaea3ef69d9680eeafc8d5ad198b896ec8"
uuid = "2da68c74-98d7-5633-99d6-8493888d7b1e"
version = "0.3.0"

[[Syslogs]]
deps = ["Compat", "Nullables"]
git-tree-sha1 = "d3e512a044cc8873c741d88758f8e1888c7c47d3"
uuid = "cea106d9-e007-5e6c-ad93-58fe2094e9c4"
version = "0.2.0"

[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[TimeZones]]
deps = ["Compat", "EzXML", "Mocking", "Nullables"]
git-tree-sha1 = "5437144a2bbb5b661783ad34b0d19d5696845b25"
uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53"
version = "0.8.5"

[[UUIDs]]
deps = ["Random"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[[Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

[[XMLDict]]
deps = ["DataStructures", "EzXML", "IterTools", "Test"]
git-tree-sha1 = "77a40486f4e5c81c57867d056933022bc4c5fe02"
uuid = "228000da-037f-5747-90a9-8195ccbf91a5"
version = "0.3.0"
5 changes: 5 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
Documenter = "~0.21"
7 changes: 3 additions & 4 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Documenter, CloudWatchLogs

makedocs(;
modules=[CloudWatchLogs],
format=:html,
format=Documenter.HTML(prettyurls=(get(ENV, "CI", nothing) == "true")),
pages=[
"Home" => "index.md",
"API" => "pages/api.md",
Expand All @@ -15,12 +15,11 @@ makedocs(;
"assets/invenia.css",
"assets/logo.png",
],
strict = true,
checkdocs = :exports,
)

deploydocs(;
repo="github.com/invenia/CloudWatchLogs.jl",
target="build",
julia="0.6",
deps=nothing,
make=nothing,
)
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ To add a handler with a unique stream to the root logger on each process:

```julia
@everywhere using Memento
@everywhere using Compat.UUIDs
@everywhere using UUIDs
@everywhere push!(getlogger("root"), CloudWatchLogHandler(aws_config(), "my-log-group", "my-log-stream-$(uuid1())"))
```

Expand Down
5 changes: 2 additions & 3 deletions src/CloudWatchLogs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ module CloudWatchLogs

using AWSCore: AWSConfig, AWSException
using AWSCore.Services: logs
using Compat: @__MODULE__, Nothing, AbstractDict
using Compat.Dates
using Compat.UUIDs
using Dates
using MbedTLS: MbedException
using Memento
using Mocking
using TimeZones
using UUIDs

export CloudWatchLogStream, LogEvent, submit_log, submit_logs
export create_group, delete_group, create_stream, delete_stream
Expand Down
1 change: 0 additions & 1 deletion test/REQUIRE

This file was deleted.

26 changes: 26 additions & 0 deletions test/mocked_aws.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ function submit_patch(log_dump)
end
end

function throttle_patch()
first_time = true
@patch function _put_log_events(stream::CloudWatchLogStream, events::AbstractVector{CloudWatchLogs.LogEvent})
if first_time
first_time = false
throw(AWSException("ThrottlingException", "", "", HTTP.ExceptionRequest.StatusError(400, "")))
end

return Dict()
end
end

streams = [
Dict(
"storageBytes" => 1048576,
Expand Down Expand Up @@ -91,4 +103,18 @@ end
end
end

@testset "Throttled" begin
start_time = CloudWatchLogs.unix_timestamp_ms()
apply([dls_patch(Dict("logStreams" => streams)), throttle_patch()]) do
stream = CloudWatchLogStream(CFG, "my-log-group-1", "my-log-stream-1")
event = LogEvent("log", start_time)

setlevel!(LOGGER, "debug") do
@test_log LOGGER "debug" "ThrottlingException" begin
submit_log(stream, event)
end
end
end
end

end
Loading

0 comments on commit 0323eee

Please sign in to comment.