Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build modules before testing with Travis #423

Open
taboege opened this issue Dec 27, 2018 · 1 comment
Open

Build modules before testing with Travis #423

taboege opened this issue Dec 27, 2018 · 1 comment

Comments

@taboege
Copy link
Member

taboege commented Dec 27, 2018

The Travis CI script does not zef build new modules before zef testing them. This can cause tests to fail. (For instance, see https://travis-ci.org/perl6/ecosystem/builds/472346894#L1435 where the file being used does not exist because it is normally generated in the build phase, which is skipped. Note that this issue is independent of any "hack" I mentioned in #422 corresponding to that build failure -- the missing file is a program needed by all tests of the module, because the module is an interface to that program.)

The Problem

I use Build.pm, which is executed by zef build, to generate resources files. These files are needed for the module to function and to pass its tests. The Travis script skips the build phase between installing dependencies and testing the module:

my $zef = run "zef", "install", "--depsonly", "--/build", ".";
ok $zef.exitcode eq 0, "Able to install deps";
$zef = run "zef", "test", ".";
ok $zef.exitcode eq 0, "Package tests pass";

My understanding is that this is a legitimate use of Build.pm. zef includes the build phase when you install a module.

More Problem

It is not as easy as adding a zef build invocation because that fails when no build file exists. I'm not sure how standardized the build procedure is. According to zef source the build file can be called Build.pm or Build.pm6 and the whole thing is a giant ball of shit.

Steps to reproduce

The build failure linked in the first paragraph is from SAT::Solver::MiniSAT:

$ git clone https://github.com/taboege/p6-SAT-Solver-MiniSAT
$ cd p6-SAT-Solver-MiniSAT

What the Travis script does:

$ zef install --depsonly --/build .
All candidates are currently installed
$ zef test .
===> Testing: SAT::Solver::MiniSAT:ver<0.0.1>
# Failed test 'SAT::Solver::MiniSAT module can be use-d ok'
# at t/00-use.t line 8
# ===SORRY!=== Error while compiling /tmp/p6-SAT-Solver-MiniSAT/lib/SAT/Solver/MiniSAT.pm6 (SAT::Solver::MiniSAT)
# An exception occurred while evaluating a BEGIN
# at /tmp/p6-SAT-Solver-MiniSAT/lib/SAT/Solver/MiniSAT.pm6 (SAT::Solver::MiniSAT):35
# Exception details:
#   Failed to find '/tmp/p6-SAT-Solver-MiniSAT/resources/minisat' while trying to do '.mode'
#     in code  at /tmp/p6-SAT-Solver-MiniSAT/lib/SAT/Solver/MiniSAT.pm6 (SAT::Solver::MiniSAT) line 35
#     in code  at /tmp/p6-SAT-Solver-MiniSAT/lib/SAT/Solver/MiniSAT.pm6 (SAT::Solver::MiniSAT) line 35
# 
# 
# Looks like you failed 1 test of 2

With zef build:

$ zef install --depsonly --/build .
All candidates are currently installed
$ zef build .
# compilation noise from minisat...
$ zef test .
===> Testing: SAT::Solver::MiniSAT:ver<0.0.1>
===> Testing [OK] for SAT::Solver::MiniSAT:ver<0.0.1>
JJ added a commit that referenced this issue Dec 28, 2018
JJ added a commit that referenced this issue Dec 28, 2018
In the process, solves #423. Please check that everything is correct,
and reopne if it's not.
@JJ
Copy link
Contributor

JJ commented Jul 12, 2020

Let's try and see the status of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants