[erlang-questions] Odd behaviour of code:priv_dir/1

Hugo Mills hugo@REDACTED
Sun Feb 17 19:47:56 CET 2019


   I've been trying to set up a basic CI system for a few projects.
The problem is, I'm consistently getting test failures when running
tests through the CI, where those tests pass perfectly well on a
manual run.

   The test failure is:

=== Ended at 2019-02-17 15:36:20
=== Location: [{filename,join,446},
              {stdlib_SUITE,run_suite,37},
              {test_server,ts_tc,1545},
              {test_server,run_test_case_eval1,1063},
              {test_server,run_test_case_eval,995}]
=== Reason: no function clause matching 
                 filename:join({error,bad_name},"stdlib") (filename.erl, line 446)
  in function  stdlib_SUITE:run_suite/3 (test/stdlib_SUITE.erl, line 37)
  in call from test_server:ts_tc/3 (test_server.erl, line 1545)
  in call from test_server:run_test_case_eval1/6 (test_server.erl, line 1063)
  in call from test_server:run_test_case_eval/9 (test_server.erl, line 995)


which comes from this line of code in my CT text fixture:

    BaseContext =
        #{"$module_path"
	     => [filename:join(code:priv_dir(childe), "stdlib")],
          "$data_path"
	     => [?config(data_dir, Conf)]},

   I can run this on my main dev machines ("make ct" -- I'm using
erlang.mk) quite happily, and it passes the test. I can run it
manually on the CI worker machine and it passes the test. If I run it
through a CI system, it fails with the above error.

   There's clearly _something_ odd about the environment that the CI
system is running in, but I'm damned if I can tell what it is. It's
not specific to the CI system, either: I've seen this with Buildbot,
yesterday, and now GoCD today.

   Why would code:priv_dir/1 be failing in the CI when it's working in
an interactive shell?

   My dev machines are running 21.2.2 from Debian; the CI is running
21.2.5 from Erlang Solutions, but that's not the issue, because I can
do a manual run on the CI box, and it works.

   Thanks for any ideas,
   Hugo.

-- 
Hugo Mills             | I used to live in hope, but I got evicted.
hugo@REDACTED carfax.org.uk |
http://carfax.org.uk/  |
PGP: E2AB1DE4          |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20190217/2cef8c92/attachment.bin>


More information about the erlang-questions mailing list