Skip to content

#284 Optimization of VC UTBot Quickstart wizard #302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ message("Organisation: ${PROJECT_ORG}")
message("Homepage: ${CMAKE_PROJECT_HOMEPAGE_URL}")
message("Version: ${CMAKE_PROJECT_VERSION}")
message("Run from: ${RUN_INFO}")
include_directories(${PROJECT_BINARY_BIN})

configure_file(config.h.in config.h @ONLY)

Expand Down
6 changes: 5 additions & 1 deletion server/proto/testgen.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "util.proto";
import "google/protobuf/duration.proto";

service TestsGenService {
rpc Handshake(DummyRequest) returns(DummyResponse) {}
rpc Handshake(VersionInfo) returns(VersionInfo) {}

rpc Heartbeat(DummyRequest) returns(HeartbeatResponse) {}

Expand Down Expand Up @@ -59,6 +59,10 @@ message DummyRequest {}

message DummyResponse {}

message VersionInfo {
string version = 1;
}

message RegisterClientRequest {
string clientId = 1;
}
Expand Down
9 changes: 5 additions & 4 deletions server/src/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const std::string Server::logPrefix = "logTo";
const std::string Server::gtestLogPrefix = "gtestLogTo";

void Server::run(uint16_t customPort) {
LOG_S(INFO) << "UnitTestBot Server, build " << UTBOT_BUILD_NUMBER;
LOG_S(INFO) << "UnitTestBot Server, build " << UTBOT_BUILD_VERSION;
LOG_S(INFO) << "Logs directory: " << Paths::logPath;
LOG_S(INFO) << "Latest log path: " << Paths::getUtbotLogAllFilePath();
LOG_S(INFO) << "Tmp directory path: " << Paths::tmpPath;
Expand Down Expand Up @@ -157,9 +157,10 @@ Status Server::TestsGenServiceImpl::GeneratePredicateTests(ServerContext *contex
}

Status Server::TestsGenServiceImpl::Handshake(ServerContext *context,
const DummyRequest *request,
DummyResponse *response) {
LOG_S(INFO) << "Handshake complete";
const VersionInfo *request,
VersionInfo *response) {
LOG_S(INFO) << "Handshake complete. Client version: " << request->version();
response->set_version(UTBOT_BUILD_VERSION);
return Status::OK;
}

Expand Down
4 changes: 2 additions & 2 deletions server/src/Server.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ class Server {
explicit TestsGenServiceImpl(bool testMode);

Status Handshake(ServerContext *context,
const DummyRequest *request,
DummyResponse *response) override;
const VersionInfo *request,
VersionInfo *response) override;

Status OpenLogChannel(ServerContext *context,
const LogChannelRequest *request,
Expand Down
3 changes: 2 additions & 1 deletion server/src/Version.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef UNITTESTBOT_VERSION_H
#define UNITTESTBOT_VERSION_H

#define UTBOT_BUILD_NUMBER "DEVBUILD"
#include "config.h" //CMake generated
#define UTBOT_BUILD_VERSION PROJECT_VERSION

#endif //UNITTESTBOT_VERSION_H
2 changes: 1 addition & 1 deletion server/src/utils/StringFormat.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace StringUtils {
}
formatBuffer.resize(std::max(formatBuffer.size(), size));
snprintf(formatBuffer.data(), size, format.c_str(), internal::extractCString(std::forward<Args>(args))...);
return std::string(formatBuffer.begin(), formatBuffer.begin() + size - 1); // We don't want the '\0' inside
return {formatBuffer.begin(), formatBuffer.begin() + size - 1}; // We don't want the '\0' inside
}
}

Expand Down
31 changes: 18 additions & 13 deletions vscode-plugin/media/vscode.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,34 +73,39 @@ button.secondary:hover {
background: var(--vscode-button-secondaryHoverBackground);
}

button:disabled,
button[disabled] {
color: var(--vscode-debugIcon-breakpointDisabledForeground);
background: var(--vscode-button-secondaryBackground);
}
button:disabled:hover,
button:hover[disabled] {
cursor: default;
}


input:not([type='checkbox']),
textarea {
display: block;
width: 100%;
border: none;
outline-style: solid;
outline-width: thin;
outline-color: var(--vscode-input-border);
font-family: var(--vscode-font-family);
padding: var(--input-padding-vertical) var(--input-padding-horizontal);
color: var(--vscode-input-foreground);
outline-color: var(--vscode-input-border);
background-color: var(--vscode-input-background);
}

input::placeholder,
textarea::placeholder {
color: var(--vscode-input-placeholderForeground);
color: var(--vscode-input-placeholderForeground, #cccccc);
}

label {
font-family: var(--vscode-font-family);
}

input[type = "*"]:disabled,
input[disabled] {
color: var(--vscode-disabledForeground);
background: var(--vscode-disabledBackground);
cursor: default;
}

button:disabled,
button[disabled] {
color: var(--vscode-debugIcon-breakpointDisabledForeground);
background: var(--vscode-button-secondaryBackground);
cursor: default;
}
95 changes: 28 additions & 67 deletions vscode-plugin/media/wizard.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
:root {
--custom-shaded-backgroud: rgba(0, 0, 0, 0.3);
}

.utbot-form {
background-color: var(--vscode-welcomePage-background);
margin: 150px auto;
margin-top: 75px;
margin: auto auto;
margin-top: 15px;
vertical-align: middle;
padding: 40px;
width: 70%;
Expand All @@ -16,6 +12,7 @@
/* Hide all steps by default: */
.utbot-form__tab {
display: none;
min-height: 280px;
}

.utbot-form__tab.active {
Expand All @@ -32,54 +29,56 @@
height: 10px;
width: 10px;
margin: 0 2px;
/* background-color: #bbbbbb; */

background-color: var(--vscode-titleBar-activeForeground);
/* background-color: #bbbbbb; */
border: none;
border-radius: 50%;
display: inline-block;
opacity: 0.5;

opacity: 50%;
}

/* Mark the active step: */
.utbot-form__steps_step.active {
opacity: 1;
opacity: 100%;
}

.utbot-form__tab_label {
text-align: right;
margin-top: 10px;
margin-right: 15px;
float:left;
}

.utbot-form__tab_input {
margin-top: 5px;
}

.utbot-form__tab_item {
margin-top: 15px;
margin-bottom: 15px;
}

.utbot-form__tab_connection_test-button {
max-width: 30%;
display: inline-block;
margin-top: 5px;
margin-bottom: 5px;
}

/* By default turn off connection status */
.utbot-form__tab_connection_loader,
.utbot-form__tab_connection_success,
.utbot-form__tab_connection_failure {
#connection_loader,
#connection_success,
#connection_warning,
#connection_failure {
display: none;
}

.utbot-form__tab_connection_loader.active,
.utbot-form__tab_connection_success.active,
.utbot-form__tab_connection_failure.active {
#connection_loader.active,
#connection_success.active,
#connection_warning.active,
#connection_failure.active {
display: inline-block;
}

.utbot-form__steps_step.finish {
background-color: var(--vscode-editorInfo-foreground);
}

.utbot-form__tab_input {
box-sizing: border-box;
}

.utbot-form__navigation {
display: flex;
flex-direction: row;
Expand Down Expand Up @@ -117,52 +116,14 @@
margin-right: 0;
}

.utbot-form__tab {
min-height: 190px;
}

/** Connection loader **/
.utbot-form__tab_connection_loader.active {
top: 5px;
position: relative;
height: 100%;
}

.utbot-form__tab_connection_loader.active:after {
content: " ";
display: block;
border-radius: 50%;
width: 0;
height: 0;
margin: 0px;
box-sizing: border-box;
border: 10px solid #fff;
border-color: #fff transparent #fff transparent;
animation: lds-hourglass 1.2s infinite;
}

@keyframes lds-hourglass {
0% {
transform: rotate(0);
animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
}
50% {
transform: rotate(900deg);
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}
100% {
transform: rotate(1800deg);
}
}

.utbot-modal {
position: fixed;
top: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
height: 0vh;
height: 0;
overflow: hidden;
transition: background-color 0.25s ease;
z-index: 9999;
Expand Down Expand Up @@ -283,7 +244,7 @@
background: var(--vscode-diffEditor-diagonalFill);
}

.utbot-modal__close-button::before,
.utbot-modal__close-button::before,
.utbot-modal__close-button::after {
content: "";
position: absolute;
Expand Down Expand Up @@ -311,7 +272,7 @@
transform: rotate(-45deg);
}

.utbot-modal__close-button.thick::before,
.utbot-modal__close-button.thick::before,
.utbot-modal__close-button.thick::after {
height: 4px;
margin-top: -2px;
Expand Down
Loading