mani-language / Mani

Máni ... an awesome, super simple programming language!
https://mani-language.github.io/
Mozilla Public License 2.0
28 stars 7 forks source link

Add option to use local stdlib when running tests on CI #82

Closed Kalekdan closed 5 years ago

Kalekdan commented 5 years ago

Is your feature request related to a problem? Please describe. When making changes to the stdlib, the changes are not tested on CI until it is merged since they will not yet be in the master branch of the repo.

Describe the solution you'd like An option to force Máni to not use internet version of stdlib and use local version instead. Perhaps a command line parameter that could be passed that would flag specific runs to use local stdlib. Even if we then have to trigger another "local stdlib" rerun once a pull request is ready, it would be better than waiting until the PR is merged until we know whether it will pass or not.

Describe alternatives you've considered Making CI always not connect to the internet - not keen on this idea though as this could end up hiding genuine issues with the internet functionality.

Additional context Add any other context or screenshots about the feature request here.

crazywolf132 commented 5 years ago

I think to accompany this, we should create a full build task to gradle to include all the std-libs in the jar

Kalekdan commented 5 years ago

@crazywolf132 What would be the preference here? Tests run using local stdlib by default unless otherwise specified? I could add a command line parameter to the ./test.sh

crazywolf132 commented 5 years ago

@Kalekdan

What do you mean by local? In the jar?

One way we could go about this is by providing all the std-libs in the resources folder. That way it will naturally use the internet versions if there is a live connection, or the local ones of that version.

A way we could make this work with the test system is by taking advantage of the system API, and using the API point that toggles off the internet connection manually.

Kalekdan commented 5 years ago

@crazywolf132 I'm not sure I follow - the issue is that our CI is always using the internet versions so when an update is made to the stdlib, tests in a PR are failing (since it is not using the updated 'local' stdlib)

I agree that we should include the stdlibs into the resources folder, otherwise in order to test non-internet versions we would have to install Máni on every CI run. I'll take a look at some possible solutions.

Kalekdan commented 5 years ago

Another alternative could be to use the internet versions of the stdlib from whichever source repo the pull request is made. CircleCI has a built in environment variable for the source repo

crazywolf132 commented 5 years ago

Awesome!

I just have one requested change added to the pull.

I think we should also consider the idea of packaging the stdlibs with the jar (maybe a mega release) for those people who wont have internet connection after they download.

Other than that, we are good to go.

Kalekdan commented 5 years ago

I think we should also consider the idea of packaging the stdlibs with the jar (maybe a mega release) for those people who wont have internet connection after they download.

Do you want this to replace the existing behavior when they don't have an active internet connection? (i.e. stdlib in the user.home/mani directory)

crazywolf132 commented 5 years ago

Closing due to latest merge 773eac1 finishing this.