Conversation
CI here was .travis.yml, targeting OTP 18.3 through 21.0. Travis stopped serving open source projects in 2021, so nothing has run against this repo since. This replaces it with a GitHub Actions workflow that compiles and runs eunit on OTP 26, 27 and 28 -- 26 being what chef-server currently pins, with 27 and 28 covered so regressions show up before that pin moves. Three things had to be fixed before the suite could run at all. eper blocked the test profile. It is a debugging tool, not a test dependency: it is declared in rebar.config and referenced nowhere in src/ or test/. Its upstream was last pushed in 2018, and prfPrc.erl matches on the float 0.0, which OTP 26 warns about on behalf of OTP 27. warnings_as_errors turns that into a failure, so `rebar3 eunit` did not get as far as running a test. Removed. Most of the suite is not a unit test. opscoderl_ibrowse_test_, multi_request_test and process_leak_test make live requests to a dozen third-party hosts -- google.com, www.sun.com, yaws.hyber.org, www.httpwatch.com, jigsaw.w3.org (eighteen times) and others -- and assert HTTP 200 from them. As a merge gate that fails whenever one of those is slow, moved or gone, and three already fail on OTP 26 because ssl now defaults to verify_peer and those requests supply no CA certs. They are kept and can be run by setting OPSCODERL_HTTPC_NETWORK_TESTS=1; by default the workflow runs only the deterministic suites. request_error_test_ only passed because something else ran first. It calls oc_httpc:add_pool/2, which needs pooler running, but its setup started only ibrowse -- pooler was started by opscoderl_ibrowse_test_'s setup. Skipping the network suites surfaced that immediately as two cancelled tests. Its setup now starts pooler itself. Verified in containers: 3 tests, 0 failures on OTP 26, 27 and 28, and 34 tests with OPSCODERL_HTTPC_NETWORK_TESTS=1 (3 failing, on the TLS change described above). Dialyzer is included but not a gate. Four warnings stand on main: three are lager's parse transform expanding into lager:do_log/10, lager:md/0 and lager_config:get/2, which dialyzer cannot resolve -- removing lager clears all three -- and one is pooler:time_spec/0, a type pooler uses internally but never exports, so oc_httpc's spec refers to something that is not public. Once both are addressed the job should drop continue-on-error and gate. .gitignore gains _build/ and rebar.lock; its existing entries (deps/, ebin/, .eunit) are rebar2's, so a rebar3 build leaves the tree dirty. Signed-off-by: Tim Smith <tim@mondoo.com>
Author
|
Confirmed the workflow actually executes, rather than only that the commands work locally. The run on
That is the intended behaviour: dialyzer reports its four known warnings without failing the run, because of Approving the workflow run on this PR will reproduce the same result here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI here was
.travis.yml, targeting OTP 18.3 through 21.0. Travis stopped serving open source projects in 2021, so nothing has run against this repo since. This replaces it with a GitHub Actions workflow that compiles and runs eunit on OTP 26, 27 and 28 — 26 being what chef-server currently pins, with 27 and 28 covered so regressions surface before that pin moves.Three things had to be fixed before the suite would run at all.
1.
eperblocked the entire test profileIt is a debugging tool, not a test dependency — declared in
rebar.configand referenced nowhere insrc/ortest/. Its upstream was last pushed in 2018, andprfPrc.erlmatches on the float0.0, which OTP 26 warns about on behalf of OTP 27:warnings_as_errorsturns that into a failure, sorebar3 eunitnever got as far as running a test. Removed.2. Most of the suite is not a unit test
opscoderl_ibrowse_test_,multi_request_testandprocess_leak_testmake live requests to twelve third-party hosts and assert HTTP 200 from them:google.com·www.sun.com·www.oracle.com·www.bbc.co.uk·yaws.hyber.org·www.httpwatch.com·github.com·mail.google.com·jigsaw.w3.org(eighteen times)As a merge gate that fails whenever one of those is slow, moved or gone. Three already fail on OTP 26, where
ssldefaults toverify_peerand those requests supply no CA certs:They are kept, not deleted — run them with
OPSCODERL_HTTPC_NETWORK_TESTS=1. By default the workflow runs only the deterministic suites.3.
request_error_test_only passed because something else ran firstIt calls
oc_httpc:add_pool/2, which needspoolerrunning, but its own setup started onlyibrowse—poolerwas being started byopscoderl_ibrowse_test_'s setup. Skipping the network suites surfaced this immediately as two cancelled tests. Its setup now startspooleritself, so it stands alone.Verified
OPSCODERL_HTTPC_NETWORK_TESTS=1Dialyzer is included but not a gate
Four warnings stand on
main:lager:do_log/10,lager:md/0andlager_config:get/2, which dialyzer cannot resolve. Move off lager onto OTP logger #21 removes lager and clears all three — I confirmed that separately (4 warnings → 1).pooler:time_spec/0: pooler uses that type internally but never-export_types it, sooc_httpc.erl:134's spec refers to something that is not public.plt_extra_appsdoes not help — I tried. It needs either an export in pooler or a local type here.Once both are addressed the job should drop
continue-on-errorand gate.Also
.gitignoregains_build/andrebar.lock. Its existing entries (deps/,ebin/,.eunit) are rebar2's, so any rebar3 build currently leaves the tree dirty.