Skip to content

wc test failing on different platforms #79

Closed

Description

@guillermo-carrasco

Because the output of wc is slightly different depending on the platform (linux/mac) or flavour (ubuntu, debian, etc.). The test does fail even if the job executes correctly, because it is checking the expected file size instead of the actual number of words in the file.

Activity

  1. mr-c commented on Oct 26, 2015

    @mr-c
    Member

    @guillermo-carrasco Is this still an issue?

  2. guillermo-carrasco commented on Oct 27, 2015

    @guillermo-carrasco
    ContributorAuthor

    Hi @mr-c ,

    That was quite a white ago and a lot of things changed. I've re-pulled and re-installed everything, tried to run the tests, and got this:

    (master) ~/repos_and_code/common-workflow-language (master) ~> ./run_test.sh
    readlink: illegal option -- f
    usage: readlink [-n] [file ...]
    --- Running conformance test draft-2 on  ---
    ./run_test.sh: line 54: : command not found
    Test [1/36] Traceback (most recent call last):
      File "/Users/guillem/anaconda/envs/master/lib/python2.7/runpy.py", line 162, in _run_module_as_main
        "__main__", fname, loader, pkg_name)
      File "/Users/guillem/anaconda/envs/master/lib/python2.7/runpy.py", line 72, in _run_code
        exec code in run_globals
      File "build/bdist.macosx-10.5-x86_64/egg/cwltool/cwltest.py", line 171, in <module>
      File "build/bdist.macosx-10.5-x86_64/egg/cwltool/cwltest.py", line 156, in main
      File "build/bdist.macosx-10.5-x86_64/egg/cwltool/cwltest.py", line 77, in run_test
      File "/Users/guillem/anaconda/envs/master/lib/python2.7/subprocess.py", line 566, in check_output
        process = Popen(stdout=PIPE, *popenargs, **kwargs)
      File "/Users/guillem/anaconda/envs/master/lib/python2.7/subprocess.py", line 710, in __init__
        errread, errwrite)
      File "/Users/guillem/anaconda/envs/master/lib/python2.7/subprocess.py", line 1335, in _execute_child
        raise child_exception
    OSError: [Errno 13] Permission denied
    
    1 tool tests failed
    

    I have to say though that I haven't spent much time trying to figure out what is the problem. I'm posting it here for the record, in case you know at first sight what may be going on, otherwise I'll try to spot the problem.

    Thanks!

  3. chapmanb commented on Oct 27, 2015

    @chapmanb
    Member
  4. guillermo-carrasco commented on Oct 27, 2015

    @guillermo-carrasco
    ContributorAuthor

    Hah, you're fast @chapmanb , thanks!

    Indeed that was the problem. I've added a small fix (see PR) and all the tests passed... except that one, so yes @mr-c , it is still a problem.

    Test [12/36] Test failed: /Users/guillem/anaconda/envs/master/bin/cwl-runner --tmp-outdir-prefix=/Users/guillem/repos_and_code/common-workflow-language/draft-2QiyzBm --tmpdir-prefix=/Users/guillem/repos_and_code/common-workflow-language/draft-2QiyzBm --outdir=/Users/guillem/repos_and_code/common-workflow-language/draft-2QiyzBm --quiet draft-2/wc-tool.cwl draft-2/wc-job.json
    Test command execution in with stdin and stdout redirection
    output expected {'output': {'checksum': 'sha1$631bfbac524e2d04cdcc5ec33ade827fc10b06ae', 'path': 'output', 'class': 'File', 'size': 15}}
                got {u'output': {u'path': u'/Users/guillem/repos_and_code/common-workflow-language/draft-2QiyzBm/output', u'checksum': u'sha1$ae852d273ed56a04c9efd6aaa6f1376d6c03f312', u'class': u'File', u'size': 25}}
    
  5. added this to the milestone on Feb 16, 2016
  6. removed this from the milestone on Jul 7, 2016
  7. buchanae commented on Mar 1, 2017

    @buchanae
    Contributor

    Confirming:

    On Ubuntu

    wc < v1.0/v1.0/whale.txt
      16  198 1111
    
    wc < v1.0/v1.0/whale.txt | shasum
    631bfbac524e2d04cdcc5ec33ade827fc10b06ae  -
    

    On Mac

    wc < v1.0/v1.0/whale.txt
          16     198    1111
    
    wc < v1.0/v1.0/whale.txt | shasum
    ae852d273ed56a04c9efd6aaa6f1376d6c03f312  -
    

    At least for test 18 "Test command execution in with stdin and stdout redirection", would replacing wc with echo or cat be better?

  8. mr-c commented on Mar 2, 2017

    @mr-c
    Member

    @buchanae Thank you for confirming

    Does the output of something more specific like wc --chars also differ?

    Happy to get a patch for test 18 that uses cat

  9. added this to the v1.1 milestone on Mar 2, 2017
  10. mr-c commented on Mar 2, 2017

    @mr-c
    Member

    And a belated thanks to @guillermo-carrasco for confirming a year ago!

  11. StarvingMarvin commented on Mar 2, 2017

    @StarvingMarvin
    Member

    There is also an issue with tests that use sort because sorting is locale dependent. Sorting whale.txt gives different results depending on wether locale is C (expected by the test script) or en_US.UTF-8 (later will apparently sort case insensitive). All that in eg. revsort.cwl which should test simple workflow.

  12. tetron commented on Mar 2, 2017

    @tetron
    Member

    Maybe we should replace those tools with Python scripts that have minimal behavior required for the test, but hopefully no variation among platforms?

  13. buchanae commented on Mar 3, 2017

    @buchanae
    Contributor

    I think it's possible that the scripts could be executed in a container that doesn't have python, right?

    Is there something in CWL spec/conformance that depends on word counting or sorting? If not, maybe the same tests can be written with ls or echo or cat

  14. added a commit that references this issue on Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions