README.md 2.54 KB
Newer Older
Valentin Reis's avatar
Valentin Reis committed
1
#### integration testing
Valentin Reis's avatar
Valentin Reis committed
2

Valentin Reis's avatar
Valentin Reis committed
3
This repository contains integration tests that validate the argo stack.
Valentin Reis's avatar
Valentin Reis committed
4
5
6
7

It leverages the argopkgs repo, but overrides some sources in it with
their master branch counterparts. see file `default.nix` for details.

Valentin Reis's avatar
Valentin Reis committed
8
The intended usage is to override (some of) the source(s) with WIP
9
version(s), as part of development or continuous integration. This
Valentin Reis's avatar
Valentin Reis committed
10
11
gitlab CI snippets shows how to do this on a nix-enabled runner. Mind
that this setup tracks argotest master.
Valentin Reis's avatar
Valentin Reis committed
12

13
``` {.yml}
Valentin Reis's avatar
Valentin Reis committed
14
15
16
17
18
19
integration.test:
  stage: test
  script:
    - BUILD=$PWD
    - git clone https://xgitlab.cels.anl.gov/argo/argotest.git
    - cd argotest
Valentin Reis's avatar
Valentin Reis committed
20
21
22
    - nix-shell -A test --run "./argotk.hs helloworld" --arg nrm-src ../.
  artifacts:
    paths:
23
24
25
26
27
28
      - 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
Valentin Reis's avatar
Valentin Reis committed
29
    expire_in: 1 week
Valentin Reis's avatar
Valentin Reis committed
30
31
32
33
34
35
  except:
    - /^wip\/.*/
    - /^WIP\/.*/
  tags:
    - integration
```
36

37
38
Standalone usage: example with the nrm source in `../`, provision the
dependencies using:
39
40

``` {.bash}
41
nix-shell -A test --arg nrm-src ../nrm
42
43
44
45
46
47
```

Then use the tool:

``` {.bash}
./argotk.hs --help
48
49
50
51
52
53
54
55
```

Output:

``` {.txt}
Usage: argotk.hs COMMAND

Available options:
56
  COMMAND                  Type of action to run
57
58
59
  -h,--help                Show this help text

Available commands:
60
61
62
63
64
  clean                    Clean sockets, logfiles.
  daemon                   Set up and launch the daemon in synchronous mode,
                           with properly cleaned sockets, logfiles.
  application              Setup stack and run an arbitrary command in a
                           container.
65
66
67
68
69
70
71
72
73
74
75
76
77
78
  helloworld               Test 1: Setup stack and check that hello world app
                           sends message back to cmd.
```

``` {.bash}
./argotk.hs helloworld --help
```

``` {.txt}
Usage: argotk.hs helloworld 
  Test 1: Setup stack and check that hello world app sends message back to cmd.

Available options:
  -h,--help                Show this help text
79
```
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

``` {.bash}
./argotk.hs application --help
```

``` {.txt}
Usage: argotk.hs application COMMAND
  Setup stack and run an arbitrary command in a container.

Available options:
  COMMAND                  Application to run inside the container
  -h,--help                Show this help text
```

##### 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).