Skip to content
Snippets Groups Projects
Unverified Commit f3c2e8f6 authored by Tomáš Pecka's avatar Tomáš Pecka
Browse files

worker: bump core version

We now build against core commmit
6fa14a8d87b625cf90204a79a415e85c87acc465 (0.0.0.r1468.g6fa14a8d8) [1].

This is a commit after new normalization was adopted. Not *that* much
of the API was broken. Notable changes are that core now returns
core::type_details instead of a std::string. Also the
std::__cxx11::basic_string types are gone and replaced with a simple
std::string.

[1] automata-library@6fa14a8d
parent 5cdd8bf8
No related branches found
No related tags found
No related merge requests found
Pipeline #184054 passed
...@@ -22,7 +22,7 @@ image: alpine:3.15 ...@@ -22,7 +22,7 @@ image: alpine:3.15
   
build:worker: build:worker:
stage: build stage: build
image: gitlab.fit.cvut.cz:5000/algorithms-library-toolkit/automata-library/cli:snapshot image: gitlab.fit.cvut.cz:5000/algorithms-library-toolkit/webui-client/core-snapshot:0.0.0.r1468.g6fa14a8d8
before_script: before_script:
- apk add --no-cache curl && curl https://alt.fit.cvut.cz/repo/alpine/alt-dev-repo.sh | sh - apk add --no-cache curl && curl https://alt.fit.cvut.cz/repo/alpine/alt-dev-repo.sh | sh
- apk add --no-cache build-base cmake jsoncpp-dev pkgconf apr-dev spdlog-dev catch2 activemq-cpp-dev argparse - apk add --no-cache build-base cmake jsoncpp-dev pkgconf apr-dev spdlog-dev catch2 activemq-cpp-dev argparse
...@@ -70,7 +70,7 @@ build:server: ...@@ -70,7 +70,7 @@ build:server:
   
test:worker: test:worker:
stage: test stage: test
image: gitlab.fit.cvut.cz:5000/algorithms-library-toolkit/automata-library/cli:snapshot image: gitlab.fit.cvut.cz:5000/algorithms-library-toolkit/webui-client/core-snapshot:0.0.0.r1468.g6fa14a8d8
dependencies: dependencies:
- build:worker - build:worker
before_script: before_script:
......
...@@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ...@@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
   
## [Unreleased] ## [Unreleased]
- Bump [core] version to ref [6fa14a8d87b625cf90204a79a415e85c87acc465](https://gitlab.fit.cvut.cz/algorithms-library-toolkit/automata-library/commit/6fa14a8d87b625cf90204a79a415e85c87acc465)
- webui: Fixed a bug where AutomatonOutput failed to open [#48](https://gitlab.fit.cvut.cz/algorithms-library-toolkit/webui-client/issues/48) - webui: Fixed a bug where AutomatonOutput failed to open [#48](https://gitlab.fit.cvut.cz/algorithms-library-toolkit/webui-client/issues/48)
- webui: Nodes with verbose output from core are now visualized in another color than output boxes and their content is now printed in monospace font - webui: Nodes with verbose output from core are now visualized in another color than output boxes and their content is now printed in monospace font
- webui: Added documentation button to algorithm boxes on canvas - webui: Added documentation button to algorithm boxes on canvas
......
...@@ -76,7 +76,7 @@ export const AlgorithmDrawer = () => { ...@@ -76,7 +76,7 @@ export const AlgorithmDrawer = () => {
handleButtonClick( handleButtonClick(
'inputString', 'inputString',
'string', 'string',
'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >', 'std:string',
[], [],
'' ''
), ),
......
...@@ -206,8 +206,7 @@ export const algorithmReducer = ( ...@@ -206,8 +206,7 @@ export const algorithmReducer = (
nodes: state.nodes.update(id, emptyNode, (node) => ({ nodes: state.nodes.update(id, emptyNode, (node) => ({
...node, ...node,
name: 'string', name: 'string',
resultType: resultType: 'std::string',
'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >',
nodeType: 'inputString', nodeType: 'inputString',
value value
})), })),
......
ARG BASE_IMAGE=gitlab.fit.cvut.cz:5000/algorithms-library-toolkit/automata-library/cli:snapshot ARG BASE_IMAGE=gitlab.fit.cvut.cz:5000/algorithms-library-toolkit/webui-client/core-snapshot:0.0.0.r1468.g6fa14a8d8
   
#----------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------
   
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
   
std::string abstractValueToString(const std::shared_ptr<abstraction::Value>& val) std::string abstractValueToString(const std::shared_ptr<abstraction::Value>& val)
{ {
std::shared_ptr<abstraction::OperationAbstraction> op = abstraction::Registry::getValuePrinterAbstraction(val->getType()); std::shared_ptr<abstraction::OperationAbstraction> op = abstraction::Registry::getValuePrinterAbstraction(val->getDeclaredType());
   
ext::ostringstream oss; ext::ostringstream oss;
op->attachInput(val, 0); op->attachInput(val, 0);
......
...@@ -20,10 +20,9 @@ Json::Value getAlgorithmOverloadJSON(const ext::tuple<abstraction::AlgorithmFull ...@@ -20,10 +20,9 @@ Json::Value getAlgorithmOverloadJSON(const ext::tuple<abstraction::AlgorithmFull
   
while (paramsIterator != params.cend() || paramsNamesIterator != paramsNames.cend()) { while (paramsIterator != params.cend() || paramsNamesIterator != paramsNames.cend()) {
Json::Value paramJSON(Json::objectValue); Json::Value paramJSON(Json::objectValue);
;
   
paramJSON["name"] = *paramsNamesIterator; paramJSON["name"] = *paramsNamesIterator;
paramJSON["type"] = std::get<0>(*paramsIterator); paramJSON["type"] = ext::to_string(std::get<0>(*paramsIterator));
   
paramsJSON.append(paramJSON); paramsJSON.append(paramJSON);
   
...@@ -31,7 +30,7 @@ Json::Value getAlgorithmOverloadJSON(const ext::tuple<abstraction::AlgorithmFull ...@@ -31,7 +30,7 @@ Json::Value getAlgorithmOverloadJSON(const ext::tuple<abstraction::AlgorithmFull
++paramsNamesIterator; ++paramsNamesIterator;
} }
   
overloadJSON["resultType"] = info.getResult().first; overloadJSON["resultType"] = ext::to_string(info.getResult().first);
overloadJSON["params"] = paramsJSON; overloadJSON["params"] = paramsJSON;
if (auto docs = std::get<1>(overload)) { if (auto docs = std::get<1>(overload)) {
overloadJSON["docs"] = *docs; overloadJSON["docs"] = *docs;
...@@ -85,13 +84,12 @@ Json::Value getCastsJSON() ...@@ -85,13 +84,12 @@ Json::Value getCastsJSON()
{ {
Json::Value castsJSON(Json::objectValue); Json::Value castsJSON(Json::objectValue);
   
for (const ext::tuple<std::string, std::string, bool>& castPair : abstraction::Registry::listCasts()) { for (const auto& [toType, fromType, isExplicit] : abstraction::Registry::listCasts()) {
const auto& isExplicit = std::get<2>(castPair);
if (isExplicit) if (isExplicit)
continue; continue;
   
const auto& from = std::get<1>(castPair); auto from = ext::to_string(fromType);
const auto& to = std::get<0>(castPair); auto to = ext::to_string(toType);
   
if (castsJSON[from].isNull()) if (castsJSON[from].isNull())
castsJSON[from] = Json::Value(Json::arrayValue); castsJSON[from] = Json::Value(Json::arrayValue);
......
...@@ -57,21 +57,32 @@ TEST_CASE("AlgorithmNode evaluate") ...@@ -57,21 +57,32 @@ TEST_CASE("AlgorithmNode evaluate")
   
TEST_CASE("AlgorithmNode multiple params evaluate") TEST_CASE("AlgorithmNode multiple params evaluate")
{ {
auto inputInt = std::make_shared<IntNode>("", 4, ext::vector<std::string>()); auto alphabetSize = std::make_shared<IntNode>("", 4, ext::vector<std::string>());
auto inputBool = std::make_shared<BoolNode>("", false, ext::vector<std::string>()); auto randomizeAlphabet = std::make_shared<BoolNode>("", true, ext::vector<std::string>());
auto node = std::make_shared<AlgorithmNode>("", "string::generate::RandomStringFactory", ext::vector<std::string>()); auto lowerCase = std::make_shared<BoolNode>("", false, ext::vector<std::string>());
auto randomAlphabet = std::make_shared<AlgorithmNode>("", "alphabet::generate::GenerateAlphabet", ext::vector<std::string>());
alphabetSize->createEdge(randomAlphabet, 0);
randomizeAlphabet->createEdge(randomAlphabet, 1);
lowerCase->createEdge(randomAlphabet, 2);
auto stringSize = std::make_shared<IntNode>("", 10, ext::vector<std::string>());
auto randomString = std::make_shared<AlgorithmNode>("", "string::generate::RandomStringFactory", ext::vector<std::string>());
auto mockOutputNode = std::make_shared<AlgorithmTestNodeMock>(); auto mockOutputNode = std::make_shared<AlgorithmTestNodeMock>();
   
inputInt->createEdge(node, 0); stringSize->createEdge(randomString, 0);
inputInt->createEdge(node, 1); randomAlphabet->createEdge(randomString, 1);
inputBool->createEdge(node, 2); randomString->createEdge(mockOutputNode, 0);
inputBool->createEdge(node, 3);
   
cli::Environment environment; cli::Environment environment;
inputInt->evaluate(environment); alphabetSize->evaluate(environment);
inputBool->evaluate(environment); randomizeAlphabet->evaluate(environment);
node->evaluate(environment); lowerCase->evaluate(environment);
randomAlphabet->evaluate(environment);
stringSize->evaluate(environment);
randomString->evaluate(environment);
mockOutputNode->evaluate(environment); mockOutputNode->evaluate(environment);
   
REQUIRE(mockOutputNode->getParams().size() == 1); REQUIRE(mockOutputNode->getParams().size() == 1);
REQUIRE(abstractValueToString(mockOutputNode->getParams().at(0)).starts_with("(LinearString content"));
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment