Skip to content
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
49 changes: 44 additions & 5 deletions test/read_only_api_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,51 @@ end

@testset "Activity" begin
# test GitHub.stargazers, GitHub.starred
@test length(first(stargazers(ghjl; auth = auth))) > 10 # every package should fail tests if it's not popular enough :p
@test_skip hasghobj(ghjl, first(starred(testuser; auth = auth))) # TODO FIXME: Fix these tests. https://github.com/JuliaWeb/GitHub.jl/issues/237
stargazers_list, stargazers_page = stargazers(ghjl; auth)
@test stargazers_list isa Vector{Owner}
@test stargazers_page isa Dict
@test all(x -> x isa Owner, stargazers_list)
@test !isempty(stargazers_list)

starred_list, starred_page = starred(testuser; auth = auth)
@test starred_list isa Vector{Repo}
@test starred_page isa Dict
@test all(x -> x isa Repo, starred_list)
Comment thread
arnavk23 marked this conversation as resolved.
if is_ci
if is_gha_token
@test_skip "starred_list non-empty check skipped for GHA token"
else
@test !isempty(starred_list)
end
else
@test_skip "starred_list non-empty check skipped outside CI"
end

# test GitHub.watched
repo_info = repo(ghjl; auth = auth)
watchers_list, watchers_page = watchers(ghjl; auth = auth)
@test watchers_list isa Vector{Owner}
@test watchers_page isa Dict
@test all(x -> x isa Owner, watchers_list)
Comment thread
arnavk23 marked this conversation as resolved.
@test !isempty(watchers_list)
if repo_info.subscribers_count !== nothing
@test length(watchers_list) == repo_info.subscribers_count
end

# test GitHub.watched, GitHub.watched
@test_skip hasghobj(testuser, first(watchers(ghjl; auth = auth))) # TODO FIXME: Fix these tests. https://github.com/JuliaWeb/GitHub.jl/issues/237
@test_skip hasghobj(ghjl, first(watched(testuser; auth = auth))) # TODO FIXME: Fix these tests. https://github.com/JuliaWeb/GitHub.jl/issues/237
# Test GitHub.watched
watched_list, watched_page = watched(testuser; auth = auth)
Comment thread
arnavk23 marked this conversation as resolved.
@test watched_list isa Vector{Repo}
@test watched_page isa Dict
@test all(x -> x isa Repo, watched_list)
Comment thread
arnavk23 marked this conversation as resolved.
if is_ci
if is_gha_token
@test_skip "watched_list non-empty check skipped for GHA token"
else
@test !isempty(watched_list)
end
else
@test_skip "watched_list non-empty check skipped outside CI"
end
end

testbot_key =
Expand Down
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ using Dates, Test, Base64
using GitHub: Branch, name
using GitHub.Checks

const is_ci = tryparse(Bool, get(ENV, "CI", "")) == true

@testset "GitHub.jl" begin

include("ghtype_tests.jl")
Expand Down