Skip to content

Commit

Permalink
Double dash in documentation instead of single dash and fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Yevhen Zavhorodnii committed Jun 10, 2024
1 parent fe67530 commit 9adc2bf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ The easiest way to execute Threagile on the commandline is via its Docker contai
Examples:

If you want to create an example model (via docker) as a starting point to learn about Threagile just run:
docker run --rm -it -v "$(pwd)":/app/work threagile/threagile -create-example-model -output /app/work
docker run --rm -it -v "$(pwd)":/app/work threagile/threagile --create-example-model --output /app/work

If you want to create a minimal stub model (via docker) as a starting point for your own model just run:
docker run --rm -it -v "$(pwd)":/app/work threagile/threagile -create-stub-model -output /app/work
docker run --rm -it -v "$(pwd)":/app/work threagile/threagile --create-stub-model --output /app/work

If you want to execute Threagile on a model yaml file (via docker):
docker run --rm -it -v "$(pwd)":/app/work threagile/threagile -verbose -model /app/work/threagile.yaml -output /app/work
docker run --rm -it -v "$(pwd)":/app/work threagile/threagile --verbose --model /app/work/threagile.yaml --output /app/work

If you want to run Threagile as a server (REST API) on some port (here 8080):
docker run --rm -it --shm-size=256m -p 8080:8080 --name threagile-server --mount 'type=volume,src=threagile-storage,dst=/data,readonly=false' threagile/threagile -server 8080
Expand All @@ -111,10 +111,10 @@ The easiest way to execute Threagile on the commandline is via its Docker contai
docker run --rm -it threagile/threagile -list-types

If you want to use some nice editing help (syntax validation, autocompletion, and live templates) in your favourite IDE:
docker run --rm -it -v "$(pwd)":/app/work threagile/threagile -create-editing-support -output /app/work
docker run --rm -it -v "$(pwd)":/app/work threagile/threagile --create-editing-support --output /app/work

If you want to list all available model macros (which are macros capable of reading a model yaml file, asking you questions in a wizard-style and then update the model yaml file accordingly):
docker run --rm -it threagile/threagile -list-model-macros

If you want to execute a certain model macro on the model yaml file (here the macro add-build-pipeline):
docker run --rm -it -v "$(pwd)":/app/work threagile/threagile -model /app/work/threagile.yaml -output /app/work -execute-model-macro add-build-pipeline
docker run --rm -it -v "$(pwd)":/app/work threagile/threagile --model /app/work/threagile.yaml --output /app/work --execute-model-macro add-build-pipeline
12 changes: 6 additions & 6 deletions internal/threagile/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,23 @@ const (
"Version: " + ThreagileVersion + " (%v)"
Examples = "Examples:\n\n" +
"If you want to create an example model (via docker) as a starting point to learn about Threagile just run: \n" +
" docker run --rm -it -v \"$(pwd)\":app/work threagile/threagile " + CreateExampleModelCommand + " -output app/work \n\n" +
" docker run --rm -it -v \"$(pwd)\":app/work threagile/threagile " + CreateExampleModelCommand + " --output app/work \n\n" +
"If you want to create a minimal stub model (via docker) as a starting point for your own model just run: \n" +
" docker run --rm -it -v \"$(pwd)\":app/work threagile/threagile " + CreateStubModelCommand + " -output app/work \n\n" +
" docker run --rm -it -v \"$(pwd)\":app/work threagile/threagile " + CreateStubModelCommand + " --output app/work \n\n" +
"If you want to execute Threagile on a model yaml file (via docker): \n" +
" docker run --rm -it -v \"$(pwd)\":app/work threagile/threagile analyze-model -verbose -model -output app/work \n\n" +
" docker run --rm -it -v \"$(pwd)\":app/work threagile/threagile analyze-model --verbose --model --output app/work \n\n" +
"If you want to execute Threagile in interactive mode (via docker): \n" +
" docker run --rm -it -v \"$(pwd)\":app/work threagile/threagile -i -verbose -model -output app/work \n\n" +
" docker run --rm -it -v \"$(pwd)\":app/work threagile/threagile -i --verbose --model --output app/work \n\n" +
"If you want to run Threagile as a server (REST API) on some port (here 8080): \n" +
" docker run --rm -it --shm-size=256m -p 8080:8080 --name --mount 'type=volume,src=threagile-storage,dst=/data,readonly=false' threagile/threagile server --server-port 8080 \n\n" +
"If you want to find out about the different enum values usable in the model yaml file: \n" +
" docker run --rm -it threagile/threagile " + ListTypesCommand + "\n\n" +
"If you want to use some nice editing help (syntax validation, autocompletion, and live templates) in your favourite IDE: " +
" docker run --rm -it -v \"$(pwd)\":app/work threagile/threagile " + CreateEditingSupportCommand + " -output app/work\n\n" +
" docker run --rm -it -v \"$(pwd)\":app/work threagile/threagile " + CreateEditingSupportCommand + " --output app/work\n\n" +
"If you want to list all available model macros (which are macros capable of reading a model yaml file, asking you questions in a wizard-style and then update the model yaml file accordingly): \n" +
" docker run --rm -it threagile/threagile " + ListModelMacrosCommand + " \n\n" +
"If you want to execute a certain model macro on the model yaml file (here the macro add-build-pipeline): \n" +
" docker run --rm -it -v \"$(pwd)\":app/work threagile/threagile -model app/work/threagile.yaml -output app/work execute-model-macro add-build-pipeline"
" docker run --rm -it -v \"$(pwd)\":app/work threagile/threagile --model app/work/threagile.yaml --output app/work execute-model-macro add-build-pipeline"
ThirdPartyLicenses = " - golang (Google Go License): https://golang.org/LICENSE\n" +
" - go-yaml (MIT License): https://github.com/go-yaml/yaml/blob/v3/LICENSE\n" +
" - graphviz (CPL License): https://graphviz.gitlab.io/license/\n" +
Expand Down
15 changes: 9 additions & 6 deletions pkg/risks/builtin/wrong_communication_link_content_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type WrongCommunicationLinkContentRuleTest struct {
sendAnyData bool
readonly bool
protocol types.Protocol
targetAssetType types.TechnicalAssetType
isLibrary bool
isLocalFileSystem bool
machine types.TechnicalAssetMachine
Expand Down Expand Up @@ -125,14 +126,15 @@ func TestWrongCommunicationLinkContentRuleSendDataAssetRisksCreated(t *testing.T
isLibrary: false,

riskCreated: true,
expectedReason: "(protocol type \"InterProcessCommunication\" does not match target technology type \"\": expected \"process\")",
expectedReason: "(protocol type \"inter-process-communication\" does not match target technology type \"\": expected \"process\")",
},
"protocol type InterProcessCommunication match target technology type Process": {
receiveAnyData: false,
sendAnyData: false,
readonly: false,
protocol: types.InterProcessCommunication,
isLibrary: true,
receiveAnyData: false,
sendAnyData: false,
readonly: false,
protocol: types.InterProcessCommunication,
targetAssetType: types.Process,
isLibrary: true,

riskCreated: false,
},
Expand Down Expand Up @@ -209,6 +211,7 @@ func TestWrongCommunicationLinkContentRuleSendDataAssetRisksCreated(t *testing.T
Id: "target",
Title: "Target Technical Asset",
Machine: testCase.machine,
Type: testCase.targetAssetType,
Technologies: types.TechnologyList{
{
Attributes: map[string]bool{
Expand Down

0 comments on commit 9adc2bf

Please sign in to comment.