javapathfinder / jpf-nhandler

GNU General Public License v3.0
5 stars 6 forks source link

CI setup #6

Closed cyrille-artho closed 4 months ago

cyrille-artho commented 5 months ago

Even though this project gets only infrequent updates, a CI build/test (as a GitHub action) should be configured. The action in jpf-core can be used as a template.

Harsh4902 commented 5 months ago

@cyrille-artho Can I work on this?

cyrille-artho commented 5 months ago

Yes, please do so. It is good to work on this first, as it will make testing and validating any subsequent PRs easier.

Harsh4902 commented 5 months ago

@cyrille-artho I have written YAML file for workflow. On my local machine, all the tests are working well and passing, but while running the workflow all tests are failing. Can you please tell what can be an error?

Getting same error for every test : on_the_fly.StringTest > testToLowerCase FAILED java.lang.AssertionError at StringTest.java:115 on_the_fly.StringTest > testGetBytes FAILED java.lang.AssertionError at StringTest.java:95 on_the_fly.StringTest > testSplit FAILED

build ouput: https://github.com/Harsh4902/jpf-nhandler/actions/runs/8508077814/job/23301052281

cyrille-artho commented 5 months ago

I saw two potential problems:

  1. You have a typo in touch $HOME/.jpf/site.propeties;, but the command is not needed because you use > in the next line.
  2. The directory layout is not consistent. jpf-core has to be "side by side" with jpf-nhandler. You clone jpf-core inside the project rather than in its parent directory.
Harsh4902 commented 5 months ago

Okay, I am looking into it. Thanks.

cyrille-artho commented 5 months ago

It unfortunately currently fails on the GitHub CI.

Harsh4902 commented 5 months ago

Should I revert it?

cyrille-artho commented 5 months ago

No need. It's strange that the build status in your repo was green and it fails on this repo, though.

Harsh4902 commented 5 months ago

Yeah, that blown my mind also.

cyrille-artho commented 5 months ago

The first warning in the build shows multiple extensions being set in ~/.jpf/site.properties:

WARNING: in the site.properties file, the property "extensions" has
more than one value.  However, it suffices to use
extensions = ${jpf-core}

You use jpf-numeric and jpf-apropos in addition to nhandler. I think these are indeed not needed; my own ~/.jpf/site.properties includes only jpf-core.

cyrille-artho commented 5 months ago

In fact, if you only want to develop/test nhandler but not use it otherwise, you don't even have to add nhandler itself to site.properties. I think a simple one will do:

          mkdir $HOME/.jpf;
          echo "jpf-core = ${HOME}/work/jpf-nhandler/jpf-core" >> $HOME/.jpf/site.properties;
          echo "extensions=${jpf-core}" >> $HOME/.jpf/site.properties;

Note that you're supposed to use the variable for the extension and not its value, although I don't think that causes a problem per se. Try the new, more lightweight, configuration and see what happens. If this does not fix the problem, at least it removes possible causes.

Harsh4902 commented 4 months ago

https://github.com/javapathfinder/jpf-nhandler/pull/10 Hopefully this PR will work

cyrille-artho commented 4 months ago

It passes now, thanks! I assume that the extra extension inclusions caused problems because the extensions were not available (even though they were not needed either).

Harsh4902 commented 4 months ago

It passes now, thanks! I assume that the extra extension inclusions caused problems because the extensions were not available (even though they were not needed either).

Yeah, possibly.