diff --git a/Wanda.DataCase.html b/Wanda.DataCase.html index 9f1ee828..7a898f78 100644 --- a/Wanda.DataCase.html +++ b/Wanda.DataCase.html @@ -186,9 +186,9 @@
A helper that transforms changeset errors into a map of messages.
assert {:error, changeset} = Accounts.create_user(%{password: "short"})
-assert "password is too short" in errors_on(changeset).password
-assert %{password: ["password is too short"]} = errors_on(changeset)
+A helper that transforms changeset errors into a map of messages.
assert {:error, changeset} = Accounts.create_user(%{password: "short"})
+assert "password is too short" in errors_on(changeset).password
+assert %{password: ["password is too short"]} = errors_on(changeset)
Gatherers can be thought of as functions:
Facts Gathering process in a nutshell
fact = gatherer(argument)
Gatherers can be thought of as functions:
Facts Gathering process in a nutshell
fact = gatherer(argument)
asdf allows using specific versions of programming language tools that are known to be compatible with the project, rather than relying on the version that's installed globally on the host system.
In order to use asdf, follow the official asdf getting started guide.
Install all required asdf plugins from .tool-versions inside the web repository.
cut -d' ' -f1 .tool-versions|xargs -i asdf plugin add {}
Set up the asdf environment
asdf install
asdf allows using specific versions of programming language tools that are known to be compatible with the project, rather than relying on the version that's installed globally on the host system.
In order to use asdf, follow the official asdf getting started guide.
Install all required asdf plugins from .tool-versions inside the web repository.
cut -d' ' -f1 .tool-versions|xargs -i asdf plugin add {}
Set up the asdf environment
asdf install
Often times knowing the returned value of the gathered facts is not a trivial thing, more during the implementation of new checks.
To better debug the fact gathering process and the returned values, the facts
subcommand of trento-agent
is a really useful tool. This command helps to see in the target itself what the gathered fact looks like. This is specially interesting when the returned value is a complex object or the target under test is modified and the check developer wants to see how this affects the gathered fact.
The command can be used as:
./trento-agent facts gather --gatherer corosync.conf --argument totem.token
# To see the currently available gatherers and their names
-# ./trento-agent facts list
Which would return the next where the Value
is the available value in the written check:
{
+# ./trento-agent facts list
Which would return the next where the Value
is the available value in the written check:
{
"Name": "totem.token",
"CheckID": "",
- "Value": {
+ "Value": {
"Value": 30000
- },
+ },
"Error": null
-}
Pipe the expression language functions vertically in order to provide a better visual output of the code.
So this:
expectations:
- name: some_expectation
- expect: facts.foo.find(|item| item.id == "super").properties.find(|prop| prop.name == "good").value
would be:
expectations:
+ expect: facts.foo.find(|item| item.id == "super").properties.find(|prop| prop.name == "good").value
would be:
expectations:
- name: some_expectation
expect: |
facts.foo
- .find(|item| item.id == "super").properties
- .find(|prop| prop.name == "good").value
Note: Keep in mind that some functions such as
sort
anddrain
run in-place modifications, so they cannot be piped.
Note: Keep in mind that some functions such as
sort
anddrain
run in-place modifications, so they cannot be piped.