getgauge / gauge-tests

Tests for Gauge tool (gauge tests gauge!)

Home Page:https://gauge.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve installation on linux

jgwilson42 opened this issue · comments

Having installed 64bit gauge on linux I had to modify a few of the permissions to make this work.

./install.sh was run as root as it required access to /usr/local

This caused a number of files to be setup as owned by root and not writable by my local user, including the .gauge directory in my home folder. This meant that the install of the java plugin, init and running of the sample tests failed unless run as root.

To improve this the installer should ensure that the .gauge folder is owned by the non root user.

Very valid point. We are contemplating some changes in the install procedure in getgauge/gauge#544. We are also contemplating on installing gauge to be a $USER owned location as opposed to system locations such as /usr.

Presently, the workaround is to

  • invoke ./install.sh <location_for_gauge_root>
  • export $GAUGE_ROOT = <location_for_gauge_root>
  • $PATH=$PATH:$GAUGE_ROOT/bin in your .bash_profile or equivalent.

Please post back if the above does not work!

Thanks for the feedback.

With respect to installing gauge to a user owned area. I personally like installers that don't require me to mess with $PATH after the install. This can be achieved by either installing to /usr/bin (which is already in the path) or by manipulating the $PATH after the install.

Personally I prefer the former as it seems less likely to go wrong to me.

Fair enough - will look at having just the gauge executable in /usr/local/bin and the gauge config + plugins will be in the ~/.gauge folder.

The installer is not giving me an option to enter the password of admin

Installing gauge at /usr/local/bin
Enter custom install location :-

Creating /home/sswaroop/.gauge/config ...
mkdir: cannot create directory ‘/home/sswaroop/.gauge’: Permission denied

In earlier versions of gauge it needs sudo to install it and configs are also copied under sudo access. User has to use sudo to use gauge command.

In this case .gauge folder already exists but was created with elevated permission. Now new installer script won't be able to write configs in .gauge folder.

With this commit installer gives the option to change permission or delete the .gauge folder if it exists with elevated permission.

Fix should be available in nightly >= 14-03-2017

First I installed gauge using 13th nightly with sudo permission in ubuntu.
Now I am installing with 15th nightly without sudo permission and getting the following error.

Installing gauge at /usr/local/bin
Enter custom install location :-
/tmp
Installed gauge binaries at /tmp
cp: cannot remove '/home/sswaroop/.gauge/config/gauge.properties': Permission denied
cp: cannot remove '/home/sswaroop/.gauge/config/notice.md': Permission denied
cp: cannot remove '/home/sswaroop/.gauge/config/skel/example.spec': Permission denied
cp: cannot remove '/home/sswaroop/.gauge/config/skel/env/default.properties': Permission denied

Note: Workaround is to uninstall Gauge and then install it

I think it is reasonable that if you have once installed gauge as root then you try to change the install as a non root user that it is not allowed.

With the new installer, the user will be prompted to enter the password "as and when"/if the installer comes across the needs elevated permission.

Test cases

  • Without a previously installed Gauge, the user should be able to install Gauge with default/custom path and default/custom plugins.
  • With a previously installed Gauge, the user should be able to install Gauge with default/custom path and default/custom plugins without using the sudo access.

Related issues
- [ ] getgauge/gauge#599

  • With the new installer the user should be asked for password if one tries to install in folders that need elevated permission.
  • With the new installer the html-plguin and Gauge core should be installed by default.
  • With the new installer the user should be able to specify the comma separated plugins to be installed.

@ jgwilson42: Thanks, the behavior is changing as mentioned in the previous comment. The test cases are for the new installer. Let us know what you think.

This issue was moved to getgauge/gauge#602