Skip to content

Commit 277f10c

Browse files
Dmitry Ivanovkorifey
authored andcommitted
Update CONTRIBUTING and DEVNOTE information + Fixed several minors: gitignore, execution bit, lineendings
1 parent 5d6c11a commit 277f10c

File tree

7 files changed

+53
-21
lines changed

7 files changed

+53
-21
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@
3030
*.exe
3131
*.out
3232
*.app
33+
34+
# CLion/IDEA files
35+
.idea

CONTRIBUTING.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ If not - create a new one containing:
1313
* Steps to reproduce *(to be on the same page)*
1414
* Actual and expected result *(what went wrong?)*
1515

16-
If you already have a PR with solution - link it with the created issue
16+
If you already have a PR with solution - link it with the created issue.
1717

18-
Please refer to [SmokeTest.md](SmokeTest.md) before submitting PR
18+
##How to setup development environment?
19+
20+
Please refer [Developer guide](DEVNOTE.md) to setup developer environment, build and run UTBot.
21+
22+
##How to test you PR?
23+
24+
Currently, not all checks are automized. It's required to do manual testing after PR.
25+
Please perform steps from [SmokeTest.md](SmokeTest.md) before submitting PR for reviewing.

DEVNOTE.md

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,51 @@
1+
#UTBot Developer Guide
2+
13
## How to build UTBotCpp from source
24

35
UTBot has many dependencies, so the easiest way to build the tool from source and develop it is to use the docker container.
46

5-
UTBot has a published package called [base_env](https://github.com/UnitTestBot/UTBotCpp/pkgs/container/utbotcpp%2Fbase_env).
6-
It contains all the needed dependencies such as Git, LLVM, GRPC, GoogleTest and so on. **base_env** has multiple versions tagged with dates.
7-
If you are developing the tool, you are most likely to need the most recent version.
7+
UTBot has a published docker package called [base_env](https://github.com/UnitTestBot/UTBotCpp/pkgs/container/utbotcpp%2Fbase_env).
8+
It contains all the needed dependencies such as Git, LLVM, GRPC, GoogleTest and others. **base_env** has multiple versions tagged with dates.
9+
If you are developing the tool, you are most likely to need the most recent version from [here](https://github.com/UnitTestBot/UTBotCpp/pkgs/container/utbotcpp%2Fbase_env).
810

11+
Supported and tested development configuration are Ubuntu 18.04, Ubuntu 20.04 or Windows Subsystem for Linux (+Ubuntu 18.04 / 20.04).
12+
913
To build UTBot from sources:
10-
1. Install [docker](https://docs.docker.com/engine/install/ubuntu/)
11-
2. Run the command
14+
1. Install docker for [Ubuntu](https://docs.docker.com/engine/install/ubuntu/) or [WSL+Ubuntu](https://docs.docker.com/desktop/windows/wsl/)
15+
2. Install docker plugin that allows to mount host filesystem and remap owner and group:
1216
```
1317
docker plugin install lebokus/bindfs
1418
```
15-
3. You need to do `docker login` to `ghcr.io` as described [here](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry).
16-
4. Run `utbot_docker_dev.sh` [script](https://github.com/UnitTestBot/UTBotCpp/blob/main/docker/utbot_docker_dev.sh). It will unpack the docker image and mount UTBot sources inside it.
19+
3. Login into github docker registry:
20+
```
21+
docker login -u <github-username> -p <github-personal-access-token> ghcr.io
22+
```
23+
> You can create new <personal-access-token> on [this github page](https://github.com/settings/tokens/new). Don't forget to check `read:packages` permission.
24+
> More details are described [here](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry).
25+
26+
4. Run `docker/utbot_docker_dev.sh` [script](https://github.com/UnitTestBot/UTBotCpp/blob/main/docker/utbot_docker_dev.sh). It will unpack the docker image and mount UTBot sources inside it.
1727
UTBot binary can be built in the docker and run in it.
18-
The script will prompt you to enter docker image tag. You can find the most recent tag [here](https://github.com/UnitTestBot/UTBotCpp/pkgs/container/utbotcpp%2Fbase_env), for example `24-11-2021`. Also it will ask about `ssh` port required to ssh into the container using `ssh utbot@host -p $port`, where `host` is docker host IP address (it may be `localhost`). Please, specify a port that is not taken by any process. Also, you will be prompted to enter a port where UTBot itself will be run.
19-
5. Get access to the container via
28+
The script will prompt you to enter docker image tag. You can find the most recent tag [here](https://github.com/UnitTestBot/UTBotCpp/pkgs/container/utbotcpp%2Fbase_env), for example `24-11-2021`.
2029

21-
`ssh utbot@host -p $port`
22-
23-
If you are prompted a password, type in `utbot`.
30+
Installer will ask about `ssh_port` on host machine. This port will be forwarded inside container's ssh port (by default `sshd` in container listens 2020).
31+
You may then login inside docker via `ssh utbot@host -p $ssh_port`, where `host` is a host machine IP address.
32+
> ⚠ Specify free port that is not in use on host machine!
33+
34+
Also, you will be prompted to enter a gRPC port on host machine that will be forwarded inside container's 2121 port where UTBot listens gRPC requests.
35+
> Script will run docker image, mount specified folder on host filesystem into container's filesystem and forward ports for ssh and gRPC.
36+
37+
38+
39+
5. Login via ssh into newly started container
40+
```
41+
ssh utbot@host -p $ssh_port
42+
```
43+
> You can type `localhost` as `host` if you are inside terminal of a host machine)
44+
> If you are prompted a password, enter `utbot`.
2445
25-
5. Clone UTBotCpp repository into home directory inside docker container, preferably with ssh. And don't forget to clone modules with `git submodule update --init --recursive`
46+
5. Clone UTBotCpp repository into home directory **inside docker container**, preferably with ssh.
47+
48+
And don't forget to clone modules with `git submodule update --init --recursive`
2649
6. `cd` into `UTBotCpp` directory and run `build.sh` — it is the script that builds KLEE UTBot and runs UTBot unit tests
2750
7. Navigate to `UTBotCpp/server/build` directory and launch the binary with `./utbot server` command. Now the server is running.
2851
8. Launch VS Code on your local machine. Use VS Code [Remote-SSH](https://code.visualstudio.com/docs/remote/ssh) to get access to the docker insides. Navigate to `UTBotCpp/vscode-plugin` directory and run `build.sh` script.

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ UTBot is distrbuted as an archive that contains
2424
4. A run script `unpack_and_run_utbot.sh`.
2525

2626
To launch UTBot, `unzip` the archive and run the
27-
`chmod +x unpack_and_run_utbot.sh && ./unpack_and_run_utbot.sh` command (we recommend doing it in a fresh directory to make UTBot removing easier). To remove UTBot, simply delete this directory.
27+
`./unpack_and_run_utbot.sh` command (we recommend doing it in a fresh directory to make UTBot removing easier). To remove UTBot, simply delete this directory.
2828

2929
To install UTBot VSCode plugin, use VSCode *Install from VSIX* command.
3030

3131
## How to contribute to UTBot
3232

33-
See [**DEVNOTE.md**](DEVNOTE.md)
34-
and [**CONTRIBUTING.md**](CONTRIBUTING.md)
33+
See [**CONTRIBUTING.md**](Contributing guidelines) and [**Developer guide**](DEVNOTE.md)

SmokeTest.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Move binary and script into a new separate directory
2727
and run installation script in it
2828
```
2929
cd utbot-release-version
30-
chmod +x unpack_and_run_utbot.sh && ./unpack_and_run_utbot.sh
30+
./unpack_and_run_utbot.sh
3131
```
3232
Check process is up and running
3333

@@ -42,7 +42,7 @@ PID/port 2121 should be found
4242
-[ ] Perform client setup:
4343

4444
- In local VSCode look for *Install from VSIX* command, select early downloaded ```utbot_plugin.vsix``` and install it - "UnitTestBot for C/C++" plugin should be visible in Extensions
45-
- For Win: setup SSH remote connection with server - locally installed UTBot plugin should be available in remote mode (no new installation required)
45+
- For Win: setup SSH remote connection with server![img.png](img.png)- locally installed UTBot plugin should be available in remote mode (no new installation required)
4646
- Open folder with source code, test connection as proposed, click Next and finish setup configuring project
4747

4848
##Check UTBot: Generate Tests

docker/unpack_and_run_utbot.sh

100644100755
File mode changed.

docker/utbot_docker_dev.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ read -e -p "Enter base image tag: " IMAGE_TAG
1414
IMAGE="ghcr.io/unittestbot/utbotcpp/base_env:$IMAGE_TAG"
1515

1616
echo "Pulling docker image '$IMAGE'"
17-
if ! docker pull $IMAGE > /dev/null; then
17+
if ! docker pull $IMAGE ; then
1818
echo "Failed to fetch the image. Aborting.."
1919
exit 1
2020
fi

0 commit comments

Comments
 (0)