$darkmode
Elektra 0.11.0
|
Running all the tests like the build server requires multiple dependencies. To overcome this problem, instead of trying to install all the necessary dependencies on your own, an appropriate Docker image can be used. This way you can easily and quickly run all the tests.
For anyone who wants to run all the tests, like it is done by the build server.
This is a step-by-step guide. Just follow the steps and you are good to go!
Alternatively, you can use podman, a different container engine which is compatible with Docker. See https://podman.io/ for more details and an installation guide. If you are using podman, and want to follow this tutorial, just replace the docker command with podman.
To build your own Docker image, run the following command from the source root directory:
The build process depends on your Internet connection speed and the overall performance of your hardware. Most likely, it will take at least 5 minutes. Please be patient. Once you have built the image, you can reuse it multiple times.
The image tag buildelektra-bullseye
we suggested can be replaced by a name of your own choosing.
Another alternative but not recommended(!) option would be to pick one of the publicly available Docker images of Elektra. If you do not know the difference, just pick this one --> "build-elektra-debian-stretch". Unfortunately, it will take some time to download it, since it is pretty big, but you can be sure you'll have all the needed dependencies. You can choose a light-weight Alpine image which won't take long to download, however it is not recommended. This image does not contain all necessary dependencies.
If you want to view all the available images, execute this command:
You will see something like this:
Afterwards pull your desired image as you would do from any public registry:
Example:
You have to be in the root of the source directory of the Elektra Initiative, so that the container can properly map all the source files.
So from your root source folder run the following:
After starting the container, you should be automatically inside it in the working directory /home/jenkins/workspace
.
Create a folder where Elektra will be installed, create another folder for building the source and cd
to it and like this:
Build it with
and then with
The number 10 can be changed as follows: number of supported simultaneous threads by your CPU + 2. But don't worry, this can only affect the speed of the building, it cannot really break it.
Additionally, you may want to install Elektra inside the container, because the installed tests rely on it. The build server also does this and it is possible that the installed tests have different results (e.g. if test data is missing) Just run this command:
After Elektra has been installed we need to add it to the PATH variable, meaning you and the tests can interact with Elektra by typing/executing kdb
in the command line.
Finally, run the tests. There are two sets of tests. Run the first one with this command:
For the second set to run, remember to execute make install
from the previous step. Run the second set with this command: