Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
c2f1378
add content
vol0n Feb 27, 2022
74dd383
Refactor grpc related logic (#336)
EgorkaKulikov Jul 25, 2022
d3477d1
fix: logs on windows
vol0n Jul 26, 2022
fe5070f
Merge branch 'vol0n/clion_plugin' of https://github.com/UnitTestBot/U…
vol0n Jul 26, 2022
4ae7f4e
Refactor actions and their neighborhood (#346)
EgorkaKulikov Jul 26, 2022
dffca68
Little improvements related to TODOs in code of CLion plugin (#351)
vol0n Jul 26, 2022
60ae0c7
Refactor settings in CLion plugin (#350)
EgorkaKulikov Jul 27, 2022
95b7b9a
Skip coverage line indexes which are out of bounds
vol0n Jul 28, 2022
13cab18
rename client -> currentClient
vol0n Jul 28, 2022
bb17d56
Add comments on initialization
vol0n Jul 28, 2022
2e850e8
Refactor UI and Utils related logic (#357)
EgorkaKulikov Jul 29, 2022
0dfe869
Refactor some other pieces of code (#358)
EgorkaKulikov Jul 29, 2022
131bf02
Add refresh action, show busy icon on refresh (#361)
vol0n Aug 1, 2022
36f99db
Improve some texts in CLion plugin (#362)
EgorkaKulikov Aug 1, 2022
5412cf3
Fix: do not show canceled notification on error
vol0n Aug 1, 2022
ea42013
Fix: standalone coroutine exception canceled
vol0n Aug 1, 2022
4e334f1
Fix: source folder view pane not working
vol0n Aug 1, 2022
91f3ace
fix coverage
vol0n Aug 1, 2022
d2b2b7e
Use noStateLoaded for state initialization
vol0n Aug 1, 2022
f539227
fixes
Aug 2, 2022
9457770
correct mark/unmark actions' names
Aug 2, 2022
530752b
Merge branch 'vol0n/clion_plugin' into fix_bugs_after_refactoring
Aug 2, 2022
6b3510f
Refactor UTBotRunWithCoverageLineMarkerInfo
Aug 2, 2022
8403ca0
Add button for local/wsl scenario, use spinners for int fields
vol0n Aug 2, 2022
19cc7b3
Bring all package names into line with naming requirements (#368)
vol0n Aug 4, 2022
12470a1
fix settings (#367)
vol0n Aug 4, 2022
4eafcad
use markDirtyAndRefresh (#371)
vol0n Aug 4, 2022
6439e7c
Don't change directory status on double click
vol0n Aug 4, 2022
421c7a2
Merge branch 'vol0n/clion_plugin' of https://github.com/UnitTestBot/U…
vol0n Aug 4, 2022
25f719e
Fix tests
vol0n Aug 4, 2022
78db419
fix tests
vol0n Aug 4, 2022
26f60d3
fix tests
vol0n Aug 4, 2022
8128558
fix tests
vol0n Aug 4, 2022
3d763f6
restore .vscode/settings.json
vol0n Aug 5, 2022
d6ec798
restore .vscode/settings.json
vol0n Aug 5, 2022
c0567f0
fix: with prompted result
vol0n Aug 5, 2022
e9d1b7f
remove 'Detect path' button
vol0n Aug 5, 2022
58e833c
Remove local or wsl checkbox in settings
vol0n Aug 5, 2022
0904180
change default build folder to 'build'
vol0n Aug 8, 2022
9fe2432
add plugin artifact during publish-utbot workflow (#375)
vol0n Aug 8, 2022
d94dbaa
fix ci
vol0n Aug 9, 2022
f57a6da
backup sarif report (#379)
vol0n Aug 11, 2022
b71421c
add run all tests and show coverage action (#378)
vol0n Aug 11, 2022
a10c7ec
Update md files and icons (#381)
vol0n Aug 11, 2022
b96c6b2
remove dummy server
vol0n Aug 11, 2022
83078ca
remove workflows from IJ Platform template
vol0n Aug 11, 2022
ae41ad7
small fix
vol0n Aug 11, 2022
fa8cf60
fix with prompted result action
vol0n Aug 11, 2022
d5f6f03
fix blinking during generation
vol0n Aug 12, 2022
eb68236
change actions names in search, fix progress
vol0n Aug 12, 2022
4054c7a
change vendor && notification group id
vol0n Aug 12, 2022
31527cf
fix defaults, fix notification group, use spinner
vol0n Aug 12, 2022
e352d35
disable timeout per function
vol0n Aug 12, 2022
3860756
restore use stubs
vol0n Aug 12, 2022
87d568e
Merge branch 'main' into vol0n/clion_plugin
vol0n Aug 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/build-utbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,23 @@ jobs:
./docker/action-scripts/build-vsix.sh
chmod +x docker/action-scripts/integration-tests.sh
./docker/action-scripts/integration-tests.sh
- name: Setup Java for building CLion plugin
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
- name: Run CLion integration tests
run: |
chmod +x docker/action-scripts/runClionIntegrationTests.sh
./docker/action-scripts/runClionIntegrationTests.sh
- name: Upload logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: test-report
path: |
/github/home/logs
clion-plugin/build/reports/tests/**/*

build-utbot-and-generate-test:
needs: matrix-prep
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/publish-utbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ jobs:
run: |
chmod +x docker/action-scripts/build-vsix.sh
./docker/action-scripts/build-vsix.sh
- name: Setup Java for building CLion plugin
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
- name: build CLion plugin
run: |
chmod +x docker/action-scripts/build-clion-plugin.sh
./docker/action-scripts/build-clion-plugin.sh
- name: build UTBot
run: |
chmod +x docker/action-scripts/build-utbot.sh
Expand Down
37 changes: 37 additions & 0 deletions clion-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# gradle directory
.gradle

# idea settings
.idea

# quadana settings
.qodana

# build files
build

#macos files
.DS_Store
22 changes: 22 additions & 0 deletions clion-plugin/.run/Run IDE for UI Tests.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run IDE for UI Tests" type="GradleRunConfiguration" factoryName="Gradle">
<log_file alias="idea.log" path="$PROJECT_DIR$/build/idea-sandbox/system/log/idea.log" />
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="runIdeForUiTests" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list />
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>
24 changes: 24 additions & 0 deletions clion-plugin/.run/Run IDE with Plugin.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Plugin" type="GradleRunConfiguration" factoryName="Gradle">
<log_file alias="idea.log" path="$PROJECT_DIR$/build/idea-sandbox/system/log/idea.log" />
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="--info" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="runIde" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>
24 changes: 24 additions & 0 deletions clion-plugin/.run/Run Plugin Tests.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Tests" type="GradleRunConfiguration" factoryName="Gradle">
<log_file alias="idea.log" path="$PROJECT_DIR$/build/idea-sandbox/system/log/idea.log" />
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="test" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>
26 changes: 26 additions & 0 deletions clion-plugin/.run/Run Plugin Verification.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Verifications" type="GradleRunConfiguration" factoryName="Gradle">
<log_file alias="idea.log" path="$PROJECT_DIR$/build/idea-sandbox/system/log/idea.log" />
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="runPluginVerifier" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2">
<option name="Gradle.BeforeRunTask" enabled="true" tasks="clean" externalProjectPath="$PROJECT_DIR$" vmOptions="" scriptParameters="" />
</method>
</configuration>
</component>
26 changes: 26 additions & 0 deletions clion-plugin/.run/Run Qodana.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Qodana" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="env">
<map>
<entry key="QODANA_SHOW_REPORT" value="true" />
</map>
</option>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="cleanInspections runInspections" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list />
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>
7 changes: 7 additions & 0 deletions clion-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- Keep a Changelog guide -> https://keepachangelog.com -->

# UTBotCppClion Changelog

## [Unreleased]
### Added
- Initial scaffold created from [IntelliJ Platform Plugin Template](https://github.com/JetBrains/intellij-platform-plugin-template)
93 changes: 93 additions & 0 deletions clion-plugin/CONFIGURATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Configuration

## Remote Scenario

If you run UTBot and CLion on different hosts, synchronization of project files is required:

- If UTBot is run inside the Docker container, mount your project folder to Docker.
- If UTBot is run under WSL, no additional configuration required, just
specify remote path to your project in `Settings` or use `Quickstart Wizard` to
fill it for you.
- If server is not run locally, CLion deployment can be used for synchronization, although it won't be
fully automated, look at information below:

### Configuring CLion SFTP deployment for remote scenario

To configure SFTP do the following:

- Open `Settings -> Build, Execution, Deployment -> Deployment`
- Create SFTP configuration: click `+` and choose or create SSH config with server host and port, than
specify the path to your project on the remote machine in mappings, it is the same path you have specified
in `Settings` for remote path
- Go to `Options` and turn on upload on change:

![](images/plugin_usage/sftp/sftp-config.gif)

- Go to `Project view` and right-click on your project root, then
choose `Deployment`, click `Upload to ...` and choose the name of your
SFTP configuration:

![](images/plugin_usage/sftp/upload.gif)

Now server can access your project files.

When you change your files, CLion should upload changes to server.

## Local scenario

Wizard allows you to configure your project quickly without specifying different options manually in
`Settings`. When you open your project for the first time, UTBot Wizard will be shown.

![](images/plugin_usage/wizard/wizard-welcome.png)

### Connection

After the first introductory step, you will be asked to
fill several settings: server port, server host and remote path.
Remote path specifies path to project on remote machine.

If UTBot is run on WSL or Linux (on the local machine), be sure
to check the checkbox that fills in default values for the path and the port.

![](images/plugin_usage/wizard/wizard-connection.png)

### Build Directory and CMake Options

On the final Wizard step, UTBot will ask you to:
- specify relative path to the build directory
- set custom CMake options

![](images/plugin_usage/wizard/wizard-build-options.png)

### Demo

A demo how to go through the wizard:

![](images/plugin_usage/wizard/wizard-demo.gif)

## Plugin settings

The recommended way to configure plugin is to use UTBot Wizard.

If some advanced settings are required, specify them in `Settings -> Tools -> UTBot Settings`

![](images/plugin_usage/settings-demo.gif)

### Remote path

Remote path is a path to your project on the remote host. If UTBot is run locally, leave it empty.


## Check configuration

When the connection to server is established, you can check project configuration
to make sure that all path are specified correctly: just invoke `Configure project` action:

![](images/check-config/check-not.gif)

When project is configured, `Project is configured` notification appears:

![](images/check-config/check-ok.gif)

When plugin is configured and configuration is checked, you can start using plugin to generate tests.
For further details how to use plugin see `USAGE.md`.
21 changes: 21 additions & 0 deletions clion-plugin/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Software-Analysis-Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
15 changes: 15 additions & 0 deletions clion-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# UTBotCpp-CLion-plugin
<!-- Plugin description -->
Plugin to communicate with [UTBotCpp](https://github.com/UnitTestBot/UTBotCpp) server in CLion.
<!-- Plugin description end -->

### Installation

1. Open CLion. Go to `Settings -> plugins`
2. Uninstall the previous version of plugin. Skip this step if you install it for the first time
3. Click on `Settings` icon and then choose `Install from disk`
![](images/install/install-from-disk.png)
4. Choose plugin's zip file: `clion_plugin.zip`
5. Restart CLion

See `CONFIGURATION.md` to configure the plugin before use.
Loading