Hidden flags
The iosdk
has a number of hidden flags useful for development
Global flags
--use-default-api-key
: do not generate an api key use the default one--skip-docker-version
: do not check the docker version--skip-pull-images
: do not pull images--skip-open-browser
: no not open the browser--skip-ide
: do not start the ide
Hidden commands:
wskprops
: set the .wskprops to usewsk
with the serveride-deploy
: deploy the ideide-destroy
: destroy the idewhisk-deploy
: deploy whiskwhisk-destroy
: destroy whiskredis-deploy
: deploy redisredis-destroy
: destroy redis
You can run the test suite of the cli with
cd iosdk
make test
If a test fails it may be difficult to understand what is wrong in the output.
The test command saves the test output in difftest.out
The difftest.py
comes to the rescue, you pass the test output and returns a list of failed tests , with an index:
$ python3 difftest.py
0 --- FAIL: ExampleIdeDockerRun (0.00s)
1 --- FAIL: ExampleStart (1.03s)
Then you can see what went wrong in a single test passing the index:
$ python3 difftest.py 1
31c31
< docker run -d -p 3000:3000 --rm --name iosdk-theia -e HOME=/home/project --add-host=openwhisk: 172.17.0.2 -v /tmp/iosdk-test/javascript:/home/project pagopa/iosdk-theia:test
---
> docker run -d -p 3000:3000 --rm --name iosdk-theia --add-host=openwhisk:172.17.0.2 -v /tmp/iosdk-test/javascript:/home/project pagopa/iosdk-theia:test
Bats tests are shell scripts.
The easiest way to debug them is to execute them line by line using VSCode.
First, configure a keybinding to execute a line in the terminal.
Open the keybindings.json
as described here and add this snippet:
{
"key": "ctrl+enter",
"command": "workbench.action.terminal.runSelectedText",
"when": "editorTextFocus"
}
Open a terminal, change to admnin/actions
then do a source debug-src
.
Open a test and send each line to the terminal with control-enter.