idank / explainshell

match command-line arguments to their help text
GNU General Public License v3.0
13.29k stars 794 forks source link

Run tests with GitHub Actions #303

Closed abitrolly closed 2 years ago

abitrolly commented 2 years ago

There are a couple necessary fixes with dependencies. Basically it my experience takes a few hours to setup the project and report one of the issues.

The tests fail with this problem.

Can't use 'defined(%hash)' (Maybe you should just omit the defined()?) at /home/runner/work/explainshell/explainshell/tools/w3mman2html.cgi line 223.

Which can be repeated without the test suite.

/home/runner/work/explainshell/explainshell/tools/w3mman2html.cgi "local=%2Fhome%2Frunner%2Fwork%2Fexplainshell%2Fexplainshell%2Fmanpages%2F1%2Fxargs.1.gz"

This fix is proposed in https://github.com/idank/explainshell/pull/212 but I am not proficient in Perl to review it.

Merging this PR will at least allow to see if other PRs do good without executing them locally.

idank commented 2 years ago

This looks really nice. Do you mind cleaning the commits a bit, remove the debugging one and squash ones that are basically fixing bugs in the changes?

I merged #212 .

abitrolly commented 2 years ago

@idank squashed a bit. Installation and linting works without problems, but tests fail for some reason. Maybe because I had to upgrade NLTK, I don't know.

nosetests --with-doctest tests/ explainshell/
....F...........................................................................
======================================================================
FAIL: test_aliases (tests.test-manager.test_manager)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/explainshell/explainshell/tests/test-manager.py", line 70, in test_aliases
    self.assertEquals(len(mp), 2)
AssertionError: 1 != 2
abitrolly commented 2 years ago

https://github.com/abitrolly/explainshell/actions/runs/3173313405/jobs/5168787300

idank commented 2 years ago

Let's skip those tests then. I don't think they're that important since we're not using that code.

abitrolly commented 2 years ago

@idank all green now - https://github.com/abitrolly/explainshell/actions/runs/3213172763

idank commented 2 years ago

Thanks! The commit that bumps nltk can be removed since I merged https://github.com/idank/explainshell/pull/244, do you mind fixing that?

Also if it's not too much trouble can you change the commit summary to follow the style of subject: summary, e.g. tests: integrate with github actions.

abitrolly commented 2 years ago

Yup. Lemme rebase that.

abitrolly commented 2 years ago

@idank done!

idank commented 2 years ago

Merged, thanks! :)