From d43c2f10270ae9ee1509254509e3dc55a2b27c0e Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Mon, 22 Mar 2021 14:09:34 -0400 Subject: [PATCH 1/3] update TagBot --- .github/workflows/TagBot.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index d77d3a0..778c06f 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -1,9 +1,12 @@ name: TagBot on: - schedule: - - cron: 0 * * * * + issue_comment: + types: + - created + workflow_dispatch: jobs: TagBot: + if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' runs-on: ubuntu-latest steps: - uses: JuliaRegistries/TagBot@v1 From 45e2c2f09e3b5d7be06aba92db756b5ec554617e Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Mon, 22 Mar 2021 14:07:04 -0400 Subject: [PATCH 2/3] switch CI to GitHub Actions --- .github/workflows/CI.yml | 46 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 12 ----------- README.md | 3 +-- appveyor.yml | 43 ------------------------------------- 4 files changed, 47 insertions(+), 57 deletions(-) create mode 100644 .github/workflows/CI.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..e07f79a --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,46 @@ +name: CI +on: + pull_request: + branches: + - master + push: + branches: + - master + tags: '*' +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1.0' + - '1' + - 'nightly' + os: + - ubuntu-latest + arch: + - x64 + include: + - version: '1' + os: ubuntu-latest + arch: x86 + - version: '1' + os: windows-latest + arch: x64 + - version: '1' + os: macos-latest + arch: x64 + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 + with: + file: lcov.info diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ae6f931..0000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: julia -os: - - osx - - linux -julia: - - 1.0 - - 1 - - nightly -notifications: - email: false -after_success: - - julia -e 'import Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'; diff --git a/README.md b/README.md index 915ba6a..5d3ebc7 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,7 @@ This package provides for parsing and printing JSON in pure Julia. -[![Build Status](https://travis-ci.org/JuliaIO/JSON.jl.svg)](https://travis-ci.org/JuliaIO/JSON.jl) -[![Build status](https://ci.appveyor.com/api/projects/status/2sfomjwl29k6y6oy)](https://ci.appveyor.com/project/staticfloat/json-jl) +[![Build Status](https://github.com/JuliaIO/JSON.jl/workflows/CI/badge.svg)](https://github.com/JuliaIO/JSON.jl/actions/workflows/CI.yml?query=branch%3Amaster) [![codecov.io](http://codecov.io/github/JuliaIO/JSON.jl/coverage.svg?branch=master)](http://codecov.io/github/JuliaIO/JSON.jl?branch=master) ## Installation diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index d6d8cd1..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,43 +0,0 @@ -environment: - matrix: - - julia_version: 1.0 - - julia_version: 1 - - julia_version: nightly - -platform: - - x86 # 32-bit - - x64 # 64-bit - -# # Uncomment the following lines to allow failures on nightly julia -# # (tests will run but not make your overall status red) -# matrix: -# allow_failures: -# - julia_version: nightly - -branches: - only: - - master - - /release-.*/ - -notifications: - - provider: Email - on_build_success: false - on_build_failure: false - on_build_status_changed: false - -install: - - ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1")) - -build_script: - - echo "%JL_BUILD_SCRIPT%" - - C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%" - -test_script: - - echo "%JL_TEST_SCRIPT%" - - C:\julia\bin\julia -e "%JL_TEST_SCRIPT%" - -# # Uncomment to support code coverage upload. Should only be enabled for packages -# # which would have coverage gaps without running on Windows -# on_success: -# - echo "%JL_CODECOV_SCRIPT%" -# - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%" From 12209499b08eb126a045b9c39a280c9ebef2bc14 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Mon, 22 Mar 2021 14:14:28 -0400 Subject: [PATCH 3/3] fix async test listener Avoid a race condition with connecting before listening, and connect to explicit localhost IP, since the default for `listen` is IPv4, while getaddrinfo for "localhost" may return ip"::1", resulting in connection failure. --- test/async.jl | 70 +++++++++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/test/async.jl b/test/async.jl index 1612a6e..6ccacaf 100644 --- a/test/async.jl +++ b/test/async.jl @@ -1,39 +1,49 @@ +using JSON +using Test +using Distributed: RemoteChannel + +@isdefined(a) || include("json-samples.jl") + finished_async_tests = RemoteChannel() using Sockets -@async begin - s = listen(7777) - s = accept(s) - - Base.start_reading(s) - - @test JSON.parse(s) != nothing # a - @test JSON.parse(s) != nothing # b - validate_c(s) # c - @test JSON.parse(s) != nothing # d - validate_svg_tviewer_menu(s) # svg_tviewer_menu - @test JSON.parse(s) != nothing # gmaps - @test JSON.parse(s) != nothing # colors1 - @test JSON.parse(s) != nothing # colors2 - @test JSON.parse(s) != nothing # colors3 - @test JSON.parse(s) != nothing # twitter - @test JSON.parse(s) != nothing # facebook - validate_flickr(s) # flickr - @test JSON.parse(s) != nothing # youtube - @test JSON.parse(s) != nothing # iphone - @test JSON.parse(s) != nothing # customer - @test JSON.parse(s) != nothing # product - @test JSON.parse(s) != nothing # interop - validate_unicode(s) # unicode - @test JSON.parse(s) != nothing # issue5 - @test JSON.parse(s) != nothing # dollars - @test JSON.parse(s) != nothing # brackets - - put!(finished_async_tests, nothing) +let serv = listen(7777) + @async let s; try + s = accept(serv) + close(serv) + @test JSON.parse(s) != nothing # a + @test JSON.parse(s) != nothing # b + validate_c(s) # c + @test JSON.parse(s) != nothing # d + validate_svg_tviewer_menu(s) # svg_tviewer_menu + @test JSON.parse(s) != nothing # gmaps + @test JSON.parse(s) != nothing # colors1 + @test JSON.parse(s) != nothing # colors2 + @test JSON.parse(s) != nothing # colors3 + @test JSON.parse(s) != nothing # twitter + @test JSON.parse(s) != nothing # facebook + validate_flickr(s) # flickr + @test JSON.parse(s) != nothing # youtube + @test JSON.parse(s) != nothing # iphone + @test JSON.parse(s) != nothing # customer + @test JSON.parse(s) != nothing # product + @test JSON.parse(s) != nothing # interop + validate_unicode(s) # unicode + @test JSON.parse(s) != nothing # issue5 + @test JSON.parse(s) != nothing # dollars + @test JSON.parse(s) != nothing # brackets + + put!(finished_async_tests, nothing) + catch ex + @error "async test failure" _exception=ex + finally + @isdefined(s) && close(s) + close(serv) + end; end end -w = connect("localhost", 7777) +w = connect(Sockets.localhost, 7777) @test JSON.parse(a) != nothing write(w, a)