bioconda / bioconda-recipes

Conda recipes for the bioconda channel.
https://bioconda.github.io
MIT License
1.62k stars 3.24k forks source link

Docker tests: ASCIIGenome -h works, but tests still fail. #2125

Closed endrebak closed 8 years ago

endrebak commented 8 years ago

I have the setup as described in #2124

Now it seems like the test ASCIIGenome -h runs, but still the tests fail. I have appended the error message below. Does anyone have an inkling about why my tests fail? The help command seems to work, since you can see the output several times.

bash-3.2$ docker run -v `pwd`:/bioconda-recipes bioconda/bioconda-builder --packages asciigenome --env-matrix /bioconda-recipes/scripts/env_matrix.yml
Collecting git+https://github.com/conda/conda-build.git@1.20.3
  Cloning https://github.com/conda/conda-build.git (to 1.20.3) to /tmp/pip-0v7ymt0x-build
  Requirement already satisfied (use --upgrade to upgrade): conda-build==1.20.3 from git+https://github.com/conda/conda-build.git@1.20.3 in /anaconda/lib/python3.5/site-packages
Requirement already satisfied (use --upgrade to upgrade): conda in /anaconda/lib/python3.5/site-packages (from conda-build==1.20.3)
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ldd (GNU libc) 2.5
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
Packages to build
asciigenome
Building/testing subdag 0 of recipes in order:
/bioconda-recipes/recipes/asciigenome
F
======================================================================
FAIL: __main__.test_recipes('/bioconda-recipes/recipes/asciigenome', <__main__.EnvMatrix object at 0x7fe92bd29588>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/anaconda/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/bioconda-recipes/scripts/build-packages.py", line 103, in build_recipe
    assert False, "At least one build of recipe {} failed.".format(recipe)
AssertionError: At least one build of recipe /bioconda-recipes/recipes/asciigenome failed.
-------------------- >> begin captured stdout << ---------------------
Fetching package metadata: ............
ASCIIGenome
ASCIIGenome.jar
#!/bin/sh
exec java -Xmx8000m -jar /anaconda/envs/_build/share/asciigenome-0.2.0-0/ASCIIGenome.jar "$@"
Removing old build environment
BUILD START: asciigenome-0.2.0-0
Source cache directory is: /anaconda/conda-bld/src_cache
Downloading source to cache: ASCIIGenome-0.2.0.zip
Downloading https://github.com/dariober/ASCIIGenome/releases/download/v0.1.0/ASCIIGenome-0.2.0.zip
Success
Extracting download
Package: asciigenome-0.2.0-0
source tree in: /anaconda/conda-bld/work/ASCIIGenome-0.2.0
number of files: 3
Fixing permissions
Making absolute symlink bin/ASCIIGenome -> /anaconda/envs/_build/share/asciigenome-0.2.0-0/ASCIIGenome relative
Detected hard-coded path in text file share/asciigenome-0.2.0-0/ASCIIGenome
Fixing permissions
BUILD END: asciigenome-0.2.0-0
TEST START: asciigenome-0.2.0-0
Fetching package metadata: ............
Solving package specifications: .........
usage: ASCIIGenome [-h] [--region REGION] [--genome GENOME] [--fasta FASTA]
                   [--exec EXEC] [--maxReadsStack MAXREADSSTACK]
                   [--noFormat] [--nonInteractive] [--version]
                   [input [input ...]]

DESCRIPTION
Text viewer for genome alignment and annotation files.
For details see https://github.com/dariober/ASCIIGenome

positional arguments:
  input                  Input  files  to  be  displayed:  bam,  bed,  gtf,
                         bigwig, bedgraph, etc

optional arguments:
  -h, --help             show this help message and exit
  --region REGION, -r REGION
                         Go to region. Format  1-based as 'chrom:start-end'
                         or  'chrom:start'  or  'chrom'.  E.g.  chr1:1-1000
                         (default: )
  --genome GENOME, -g GENOME
                         A genome file or a  tag identifying a genome build
                         (e.g. hg19),  or  bam  file  with  suitable header
                         (default: )
  --fasta FASTA, -fa FASTA
                         Optional reference fasta file.
                         If given, must  be  indexed,  e.g.  with `samtools
                         faidx ref.fa`
  --exec EXEC, -x EXEC   Commands to be executed at  the  prompt. Must be a
                         single  string.  E.g.  'goto   chr1   &&  next  &&
                         seqRegex ACTG' (default: )
  --maxReadsStack MAXREADSSTACK, -M MAXREADSSTACK
                         Maximum  number  of  reads  to  accumulate  before
                         printing. If more than this  many reads map to the
                         window
                         randomy select them (default: 2000)
  --noFormat, -nf        Do  not  format  output   with   non  ascii  chars
                         (colour, bold, etc.) (default: false)
  --nonInteractive, -ni  Non interactive mode: Exit  after having processed
                         cmd line args. (default: false)
  --version, -v

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    java-jdk-8.0.92            |                1       122.3 MB
    asciigenome-0.2.0          |                0        27.8 MB
    ------------------------------------------------------------
                                           Total:       150.1 MB

The following NEW packages will be INSTALLED:

    asciigenome: 0.2.0-0
    java-jdk:    8.0.92-1

+ outdir=/anaconda/envs/_build/share/asciigenome-0.2.0-0
+ mkdir -p /anaconda/envs/_build/share/asciigenome-0.2.0-0
+ mkdir -p /anaconda/envs/_build/bin
+ cp ASCIIGenome.jar /anaconda/envs/_build/share/asciigenome-0.2.0-0
+ echo '#!/bin/sh'
+ echo exec java -Xmx8000m -jar /anaconda/envs/_build/share/asciigenome-0.2.0-0/ASCIIGenome.jar '"$@"'
+ chmod +x /anaconda/envs/_build/share/asciigenome-0.2.0-0/ASCIIGenome
+ ln -s /anaconda/envs/_build/share/asciigenome-0.2.0-0/ASCIIGenome /anaconda/envs/_build/bin
+ ls /anaconda/envs/_build/share/asciigenome-0.2.0-0
+ cat /anaconda/envs/_build/share/asciigenome-0.2.0-0/ASCIIGenome
+ ASCIIGenome -h
Using Anaconda Cloud api site https://api.anaconda.org

WARNING: conda-build appears to be out of date. You have version 1.20.3 but the
latest version is 1.21.11. Run

conda update -n root conda-build

to get the latest version.

TESTS FAILED: asciigenome-0.2.0-0

Fetching package metadata: ............
ASCIIGenome
ASCIIGenome.jar
#!/bin/sh
exec java -Xmx8000m -jar /anaconda/envs/_build/share/asciigenome-0.2.0-0/ASCIIGenome.jar "$@"
Removing old build environment
BUILD START: asciigenome-0.2.0-0
Source cache directory is: /anaconda/conda-bld/src_cache
Found source in cache: ASCIIGenome-0.2.0.zip
Extracting download
Package: asciigenome-0.2.0-0
source tree in: /anaconda/conda-bld/work/ASCIIGenome-0.2.0
number of files: 3
Fixing permissions
Making absolute symlink bin/ASCIIGenome -> /anaconda/envs/_build/share/asciigenome-0.2.0-0/ASCIIGenome relative
Detected hard-coded path in text file share/asciigenome-0.2.0-0/ASCIIGenome
Fixing permissions
BUILD END: asciigenome-0.2.0-0
TEST START: asciigenome-0.2.0-0
Fetching package metadata: ............
Solving package specifications: .........
usage: ASCIIGenome [-h] [--region REGION] [--genome GENOME] [--fasta FASTA]
                   [--exec EXEC] [--maxReadsStack MAXREADSSTACK]
                   [--noFormat] [--nonInteractive] [--version]
                   [input [input ...]]

DESCRIPTION
Text viewer for genome alignment and annotation files.
For details see https://github.com/dariober/ASCIIGenome

positional arguments:
  input                  Input  files  to  be  displayed:  bam,  bed,  gtf,
                         bigwig, bedgraph, etc

optional arguments:
  -h, --help             show this help message and exit
  --region REGION, -r REGION
                         Go to region. Format  1-based as 'chrom:start-end'
                         or  'chrom:start'  or  'chrom'.  E.g.  chr1:1-1000
                         (default: )
  --genome GENOME, -g GENOME
                         A genome file or a  tag identifying a genome build
                         (e.g. hg19),  or  bam  file  with  suitable header
                         (default: )
  --fasta FASTA, -fa FASTA
                         Optional reference fasta file.
                         If given, must  be  indexed,  e.g.  with `samtools
                         faidx ref.fa`
  --exec EXEC, -x EXEC   Commands to be executed at  the  prompt. Must be a
                         single  string.  E.g.  'goto   chr1   &&  next  &&
                         seqRegex ACTG' (default: )
  --maxReadsStack MAXREADSSTACK, -M MAXREADSSTACK
                         Maximum  number  of  reads  to  accumulate  before
                         printing. If more than this  many reads map to the
                         window
                         randomy select them (default: 2000)
  --noFormat, -nf        Do  not  format  output   with   non  ascii  chars
                         (colour, bold, etc.) (default: false)
  --nonInteractive, -ni  Non interactive mode: Exit  after having processed
                         cmd line args. (default: false)
  --version, -v

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    asciigenome-0.2.0          |                0        27.8 MB

The following NEW packages will be INSTALLED:

    asciigenome: 0.2.0-0
    java-jdk:    8.0.92-1

+ outdir=/anaconda/envs/_build/share/asciigenome-0.2.0-0
+ mkdir -p /anaconda/envs/_build/share/asciigenome-0.2.0-0
+ mkdir -p /anaconda/envs/_build/bin
+ cp ASCIIGenome.jar /anaconda/envs/_build/share/asciigenome-0.2.0-0
+ echo '#!/bin/sh'
+ echo exec java -Xmx8000m -jar /anaconda/envs/_build/share/asciigenome-0.2.0-0/ASCIIGenome.jar '"$@"'
+ chmod +x /anaconda/envs/_build/share/asciigenome-0.2.0-0/ASCIIGenome
+ ln -s /anaconda/envs/_build/share/asciigenome-0.2.0-0/ASCIIGenome /anaconda/envs/_build/bin
+ ls /anaconda/envs/_build/share/asciigenome-0.2.0-0
+ cat /anaconda/envs/_build/share/asciigenome-0.2.0-0/ASCIIGenome
+ ASCIIGenome -h
Using Anaconda Cloud api site https://api.anaconda.org

WARNING: conda-build appears to be out of date. You have version 1.20.3 but the
latest version is 1.21.11. Run

conda update -n root conda-build

to get the latest version.

TESTS FAILED: asciigenome-0.2.0-0

Fetching package metadata: ............
ASCIIGenome
ASCIIGenome.jar
#!/bin/sh
exec java -Xmx8000m -jar /anaconda/envs/_build/share/asciigenome-0.2.0-0/ASCIIGenome.jar "$@"
Removing old build environment
BUILD START: asciigenome-0.2.0-0
Source cache directory is: /anaconda/conda-bld/src_cache
Found source in cache: ASCIIGenome-0.2.0.zip
Extracting download
Package: asciigenome-0.2.0-0
source tree in: /anaconda/conda-bld/work/ASCIIGenome-0.2.0
number of files: 3
Fixing permissions
Making absolute symlink bin/ASCIIGenome -> /anaconda/envs/_build/share/asciigenome-0.2.0-0/ASCIIGenome relative
Detected hard-coded path in text file share/asciigenome-0.2.0-0/ASCIIGenome
Fixing permissions
BUILD END: asciigenome-0.2.0-0
TEST START: asciigenome-0.2.0-0
Fetching package metadata: ............
Solving package specifications: .........
usage: ASCIIGenome [-h] [--region REGION] [--genome GENOME] [--fasta FASTA]
                   [--exec EXEC] [--maxReadsStack MAXREADSSTACK]
                   [--noFormat] [--nonInteractive] [--version]
                   [input [input ...]]

DESCRIPTION
Text viewer for genome alignment and annotation files.
For details see https://github.com/dariober/ASCIIGenome

positional arguments:
  input                  Input  files  to  be  displayed:  bam,  bed,  gtf,
                         bigwig, bedgraph, etc

optional arguments:
  -h, --help             show this help message and exit
  --region REGION, -r REGION
                         Go to region. Format  1-based as 'chrom:start-end'
                         or  'chrom:start'  or  'chrom'.  E.g.  chr1:1-1000
                         (default: )
  --genome GENOME, -g GENOME
                         A genome file or a  tag identifying a genome build
                         (e.g. hg19),  or  bam  file  with  suitable header
                         (default: )
  --fasta FASTA, -fa FASTA
                         Optional reference fasta file.
                         If given, must  be  indexed,  e.g.  with `samtools
                         faidx ref.fa`
  --exec EXEC, -x EXEC   Commands to be executed at  the  prompt. Must be a
                         single  string.  E.g.  'goto   chr1   &&  next  &&
                         seqRegex ACTG' (default: )
  --maxReadsStack MAXREADSSTACK, -M MAXREADSSTACK
                         Maximum  number  of  reads  to  accumulate  before
                         printing. If more than this  many reads map to the
                         window
                         randomy select them (default: 2000)
  --noFormat, -nf        Do  not  format  output   with   non  ascii  chars
                         (colour, bold, etc.) (default: false)
  --nonInteractive, -ni  Non interactive mode: Exit  after having processed
                         cmd line args. (default: false)
  --version, -v

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    asciigenome-0.2.0          |                0        27.8 MB

The following NEW packages will be INSTALLED:

    asciigenome: 0.2.0-0
    java-jdk:    8.0.92-1

+ outdir=/anaconda/envs/_build/share/asciigenome-0.2.0-0
+ mkdir -p /anaconda/envs/_build/share/asciigenome-0.2.0-0
+ mkdir -p /anaconda/envs/_build/bin
+ cp ASCIIGenome.jar /anaconda/envs/_build/share/asciigenome-0.2.0-0
+ echo '#!/bin/sh'
+ echo exec java -Xmx8000m -jar /anaconda/envs/_build/share/asciigenome-0.2.0-0/ASCIIGenome.jar '"$@"'
+ chmod +x /anaconda/envs/_build/share/asciigenome-0.2.0-0/ASCIIGenome
+ ln -s /anaconda/envs/_build/share/asciigenome-0.2.0-0/ASCIIGenome /anaconda/envs/_build/bin
+ ls /anaconda/envs/_build/share/asciigenome-0.2.0-0
+ cat /anaconda/envs/_build/share/asciigenome-0.2.0-0/ASCIIGenome
+ ASCIIGenome -h
Using Anaconda Cloud api site https://api.anaconda.org

WARNING: conda-build appears to be out of date. You have version 1.20.3 but the
latest version is 1.21.11. Run

conda update -n root conda-build

to get the latest version.

TESTS FAILED: asciigenome-0.2.0-0

--------------------- >> end captured stdout << ----------------------

----------------------------------------------------------------------
Ran 1 test in 110.935s

FAILED (failures=1)
daler commented 8 years ago

All the tests do is check for exit code 0. So if ASCIIGenome exits 1 after printing the help (like a lot of tools do), then you'll need to test for that specifically, e.g,

ASCIIGenome -h || [[ $? == 1]]

and once that's working, make the output quieter for the travis logs:

ASCIIGenome -h > /dev/null 2>&1 || [[ $? == 1]]
endrebak commented 8 years ago

Thanks! I tried ASCIIGenome -h && True, which was the same idea, but absolutely moronic execution.

endrebak commented 8 years ago

@daler

With your suggestion

test:
  commands:
    - ASCIIGenome -h || [[ $? == 1]]

I get the error:

/Users/labsenter/anaconda3/conda-bld/test-tmp_dir/run_test.sh: line 3: unexpected EOF while looking for `]]'

This works however:

    - ASCIIGenome -h || True

Edit: the last command did not work in docker and it is bad anyways, as it would accept other error codes than 1.

daler commented 8 years ago

Oops, sorry, add the space before the ]]:

ASCIIGenome -h || [[ $? == 1 ]]
endrebak commented 8 years ago

Thanks again. I guess I'll have to learn bash.