GitLab maintenance scheduled for Tomorrow, 2019-03-26, from 12:00 to 13:00 CDT - Services will be unavailable during this time.

Commit 4acd5b89 authored by Valentin Reis's avatar Valentin Reis

Readme update.

parent 0fb5b21e
Pipeline #5045 passed with stage
in 33 seconds
......@@ -4,21 +4,7 @@ Integration tests that validate the argo stack, leveraging the 'argopkgs'
repository. The intended usage is to override (some of) the source(s) with WIP
version(s), as part of development or continuous integration.
### Usage (tl;dr, I already have nix on my machine.)
```bash
nix-shell -E '
(import( builtins.fetchGit {
url = https://xgitlab.cels.anl.gov/argo/argotest.git;
ref="master";
}) {
#nrm-src = /path/to/nrm
#libnrm-src = /path/to/nrm
#containers-src = /path/to/nrm
}).test' --run "argotk TestHello"
```
### Usage (in three parts)
### Usage
- [**1**] Get Nix: `curl https://nixos.org/nix/install | sh`
......@@ -39,77 +25,6 @@ in
argotest.test'
```
This environment has all the necessary Argo components in its PATH. The
argotest function has various arguments, defined in the default.nix file at the
rooto of this repository. They all have default values. For a more involved
example, let's get a custom test environment.
Here, we'll use an environment that uses a local `nrm` source, the master
`libnrm` branch and a specific revision of the `containers` branch. We'l'l use
the master `argotest` branch for that:
```nix
nix-shell -E '{ argotest ? (builtins.fetchGit {
url = https://xgitlab.cels.anl.gov/argo/argotest.git;
ref="master";})
}:
(import argotest {
nrm-src = /path/to/nrm;
libnrm-src = builtins.fetchGit {
url = https://xgitlab.cels.anl.gov/argo/libnrm.git;
ref="master"; };
containers-src = builtins.fetchGit {
url = https://xgitlab.cels.anl.gov/argo/containers.git;
ref="fancy-branch-name";
rev="commit-revisions-string";
};
}).test' --run 'argotk TestHello'
```
- [**3**] The `test`environment contains the `argotk` tool, which runs various
operations on the argo stack:
Commands list:
```{.bash}
argotk --help
```
Output:
```{.txt pipe="sh"}
argotk --help
```
Detailed help:
```{.bash}
argotk TestHello --help
```
Output:
```{.txt pipe="sh"}
argotk TestHello --help
```
#### Misc
Alternatively, one can use the `--run` option to run a test directly:
```bash
nix-shell -E '
(import( builtins.fetchGit {
url = https://xgitlab.cels.anl.gov/argo/argotest.git;
ref="master";
}) {}).test' --run "argotk TestHello"
```
#### WARNINGS
There are a few things one has to be aware of using this workflow:
- Builds may fail if the local source repositories are dirty with old build files.
### Hacking
- edit `.README.md` in place of README.md.
- the ./shake.hs build file takes care of a few things for the development
workflow (readme and completion generation).
- edit `.README.md` in place of README.md and generate using `./shake.hs`
......@@ -5,21 +5,7 @@ Integration tests that validate the argo stack, leveraging the
source(s) with WIP version(s), as part of development or continuous
integration.
### Usage (tl;dr, I already have nix on my machine.)
``` {.bash}
nix-shell -E '
(import( builtins.fetchGit {
url = https://xgitlab.cels.anl.gov/argo/argotest.git;
ref="master";
}) {
#nrm-src = /path/to/nrm
#libnrm-src = /path/to/nrm
#containers-src = /path/to/nrm
}).test' --run "argotk.hs TestHello"
```
### Usage (in three parts)
### Usage
- \[**1**\] Get Nix: `curl https://nixos.org/nix/install | sh`
......@@ -40,212 +26,7 @@ in
argotest.test'
```
This environment has all the necessary Argo components in its PATH. The
argotest function has various arguments, defined in the default.nix file
at the rooto of this repository. They all have default values. For a
more involved example, let's get a custom test environment.
Here, we'll use an environment that uses a local `nrm` source, the
master `libnrm` branch and a specific revision of the `containers`
branch. We'l'l use the master `argotest` branch for that:
``` {.nix}
nix-shell -E '{ argotest ? (builtins.fetchGit {
url = https://xgitlab.cels.anl.gov/argo/argotest.git;
ref="master";})
}:
(import argotest {
nrm-src = /path/to/nrm;
libnrm-src = builtins.fetchGit {
url = https://xgitlab.cels.anl.gov/argo/libnrm.git;
ref="master"; };
containers-src = builtins.fetchGit {
url = https://xgitlab.cels.anl.gov/argo/containers.git;
ref="fancy-branch-name";
rev="commit-revisions-string";
};
}).test' --run 'argotk.hs TestHello'
```
- \[**3**\] The `test`environment contains the `argotk.hs` tool, which
runs various operations on the argo stack:
Commands list:
``` {.bash}
argotk.hs --help
```
Output:
``` {.txt}
Usage: argotk.hs COMMAND
Available options:
COMMAND Type of test to run. There are extensive options
under each action, but be careful, these do not all
have the same defaults. The default values are
printed when you call --help on these actions.
-h,--help Show this help text
Available commands:
clean Clean sockets, logfiles.
daemon-only Set up and launch the daemon in synchronous mode,
with properly cleaned sockets, logfiles.
full-stack Setup stack and run a command in a container.
TestHello test1: Setup stack and check that a hello world app
sends message back to cmd.
TestListen test2: Setup stack and check that argo-perf-wrapper
sends at least one message to the daemon.
TestPerfwrapper test3: Setup stack and check that argo-perf-wrapper
sends at least one *performance* message to cmd
listen through the daemon.
TestPower test4: Setup stack and check that argo-perf-wrapper
sends at least one *power* message to cmd listen
through the daemon.
tests Run all tests
```
Detailed help:
``` {.bash}
argotk.hs TestHello --help
```
Output:
``` {.txt}
Usage: argotk.hs TestHello [--application APP]
[--container_name ARGO_CONTAINER_UUID]
[--output_dir DIR] [--manifest_directory DIR]
[--manifest_name FILENAME] [--cmd_run_out FILENAME]
[--cmd_run_err FILENAME] [--cmd_listen_out FILENAME]
[--cmd_listen_err FILENAME] [--daemon_out FILENAME]
[--daemon_err FILENAME] [--nrm_log FILENAME]
[--message_daemon_stdout STRING]
[--message_daemon_stderr STRING]
[--message_cmd_run_stdout STRING]
[--message_cmd_run_stderr STRING]
[--message_cmd_listen_stdout STRING]
[--message_cmd_listen_stderr STRING]
test1: Setup stack and check that a hello world app sends message back to cmd.
Available options:
--application APP Target application executable name. PATH is
inherited. (default: "echo")
--container_name ARGO_CONTAINER_UUID
Container name (default: "testContainer")
--output_dir DIR Working directory. (default: FilePath "_output")
--manifest_directory DIR Manifest lookup
directory (default: FilePath "/nix/store/9hbj77178wrp2pv8qs6d063afhdymgk2-manifests")
--manifest_name FILENAME Manifest file basename (relative to
--manifest_directory) (default: FilePath "basic.json")
--cmd_run_out FILENAME Output file (relative to --output_dir), "cmd run"
stdout (default: FilePath "cmd_run_out.log")
--cmd_run_err FILENAME Output file (relative to --output_dir), "cmd run"
stderr (default: FilePath "cmd_run_err.log")
--cmd_listen_out FILENAME
Output file (relative to --output_dir), "cmd listen"
stdout (default: FilePath "cmd_listen_out.log")
--cmd_listen_err FILENAME
Output file (relative to --output_dir), "cmd listen"
stderr (default: FilePath "cmd_listen_err.log")
--daemon_out FILENAME Output file (relative to --output_dir), daemon
stdout (default: FilePath "daemon_out.log")
--daemon_err FILENAME Output file (relative to --output_dir), daemon
stderr (default: FilePath "daemon_err.log")
--nrm_log FILENAME Output file (relative to --output_dir), daemon
log (default: FilePath "nrm.log")
--message_daemon_stdout STRING
The appearance of this character string in the daemon
stdout will be monitored during execution. When
observed, the stack will be killed and a return code
of 0 will be returned.
--message_daemon_stderr STRING
The appearance of this character string in the daemon
stdout will be monitored during execution. When
observed, the stack will be killed and a return code
of 0 will be returned.
--message_cmd_run_stdout STRING
The appearance of this character string in the cmd
run stdout will be monitored during execution. When
observed, the stack will be killed and a return code
of 0 will be
returned. (default: "someComplicatedMessage")
--message_cmd_run_stderr STRING
The appearance of this character string in the cmd
run stdout will be monitored during execution. When
observed, the stack will be killed and a return code
of 0 will be
returned. (default: "someComplicatedMessage")
--message_cmd_listen_stdout STRING
The appearance of this character string in the cmd
listen stdout will be monitored during execution.
When observed, the stack will be killed and a return
code of 0 will be returned.
--message_cmd_listen_stderr STRING
The appearance of this character string in the cmd
listen stdout will be monitored during execution.
When observed, the stack will be killed and a return
code of 0 will be returned.
-h,--help Show this help text
```
#### Misc
Alternatively, one can use the `--run` option to run a test directly:
``` {.bash}
nix-shell -E '
(import( builtins.fetchGit {
url = https://xgitlab.cels.anl.gov/argo/argotest.git;
ref="master";
}) {}).test' --run "argotk.hs TestHello"
```
#### WARNINGS
There are a few things one has to be aware of using this workflow:
- Builds may fail if the local source repositories are dirty with old
build files.
- Without using the `rev` argument, the `builtins.fetchGit` nix
command prefetches and buffers its output, with an expiration time
that ranges ten minutes by default. Use a local checkout if you need
to modify some of these sources on the fly.
### Example CI setup
``` {.yml}
integration.test:
stage: test
script:
- nix-shell -E '{ argotest ? (builtins.fetchGit {
url = https://xgitlab.cels.anl.gov/argo/argotest.git;
ref="master";})
}:
(import argotest { containers-src = ./. ; }).test' \
--run 'argotk.hs TestHello'
artifacts:
paths:
- argotest/_output/cmd_err.log
- argotest/_output/cmd_out.log
- argotest/_output/daemon_out.log
- argotest/_output/daemon_out.log
- argotest/_output/nrm.log
- argotest/_output/time.log
expire_in: 1 week
except:
- /^wip\/.*/
- /^WIP\/.*/
tags:
- integration
```
### Hacking
- edit `.README.md` in place of README.md.
- the ./shake.hs build file takes care of a few things for the
development workflow (readme and completion generation).
- edit `.README.md` in place of README.md and generate using
`./shake.hs`
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment