Setup files for the BHIMA End-to-End test server
- Note: If the installation is on bare metal, either Ubuntu LTS Desktop or Debian will work.
But if you are running on a container, there may be difficulties with installing snap
versions of
mysql-server
on Ubuntu, so use Debian instead. - Install zip (sudo apt install zip); it is needed by the 'run_tests' script
- Install regular Docker: https://docs.docker.com/engine/install/ubuntu/
(Substitute 'jenkins' or your choice of username for <user>
)
sudo adduser <user>
sudo usermod -a -G docker <user>
sudo usermod -a -G sudo <user>
- CLONE THIS REPOSITORY in the
<user>
account (read-only)- log in as
<user>
(you may need to 'su ' to do this) cd /home/<user>
git clone https://github.com:Third-Culture-Software/bhima-test-e2e.git builds
ln -s /home/<user>/builds/run_tests .
- log in as
- log in as
<user>
(you may need to 'su ' to do this) cd /home/<user>/builds
- clone the Bhima repo from Third Culture Software (read-only)
git clone https://github.com/Third-Culture-Software/bhima.git Bhima
- See Dev Install Docs
- Set up an appropriate .env file with db passwords, etc (see .env.sample)
- Verify tests run manually before proceeding (fix any configuration issues)
npm install
npm run test:clean
npm run test
npx playwright install chromium
npm run test:e2e-account
-
https://www.jenkins.io/blog/2022/12/27/run-jenkins-agent-as-a-service/
-
RUN THE TESTS (like Jenkins will)
cd <user>
- Test it:
./run_tests
- Go to the Jenkins server GUI
- Click on the test suite manager (one level down from the Dashboard)
- Click on the "Build Executor Status" link (lower left)
- Select the node you want to use to test the pull request then edit its configuration (Click on the gear on the end of the line for the node)
- Under the "Node Properties", enable the "Environment variables" section
- Add an environment varible
PULL_REQUEST
and set its value to the number of the pull request - Click on the [Save] button below
- To go back to testing master, delete the PULL_REQUEST environment varable and save
- Early attempts to run the tests in a Docker container were not succesful. Those files have been moved to the 'docker' folder. Files and scripts for Docker containers are in the 'docker' folder.