github.com/windmilleng/wat@v0.0.2-0.20180626175338-9349b638e250/README.md (about) 1 # Win At Testing with WAT! 2 3 [![Build Status](https://circleci.com/gh/windmilleng/wat/tree/master.svg?style=shield)](https://circleci.com/gh/windmilleng/wat) 4 5 Ever experienced brain freeze when you can’t quite come up with the right test 6 incantation? 7 8 Do you use your IDE to run tests because you can’t be bothered to put together 9 the regexp for the one test you care about? 10 11 Have you ever been stuck waiting on a slow test, and wondered if there was a 12 faster test that you could be running instead? 13 14 When we get frustrated at these moments, we think: `wat`. 15 16 ## What does it do? 17 18 `wat` looks at: 19 20 - how long each test takes 21 - how often each test fails 22 - what files you’ve recently edited 23 24 and runs the tests most likely to fail Right Now. 25 26 The more you use it, the more it will learn about which test gives fast, 27 useful feedback on what you’re working on. 28 29 ## Installation 30 31 If you have Go installed, it's easy to install `wat` from source: 32 33 ``` 34 go get -u github.com/windmilleng/wat/cmd/wat 35 ``` 36 37 If you don't have Go installed, we may have a precompiled binary for you on the [releases page](https://github.com/windmilleng/wat/releases). 38 39 ## Usage 40 41 From the root of your project, run 42 43 ``` 44 wat 45 ``` 46 47 The first time you run `wat`, it will: 48 49 1) detect the test commands you might want to run, then 50 2) make random changes to your codebase then run the test to see what breaks 51 52 `wat` will train itself until you interrupt it by pressing `[Enter]` or `[Esc]`. 53 54 Then (and every subsequent run), `wat` will suggest some tests and run them for you. (To see the suggested commands without auto-running them, use `--dry-run`.) 55 56 Here's an example of output you might see: 57 58 ``` 59 $ wat 60 Beginning training...type <Enter> or <Esc> to interrupt 61 Running all tests in the current workspace 62 37 / 37 [==========================================================================] 100.00% 12s 63 64 Fuzzing "cli/wat/wat.go" and running all tests 65 24 / 37 [=======================================================>------------------] 66.22% 8s 66 67 WAT will run the following commands: 68 go test github.com/windmilleng/wat/data/db/dbpath 69 go test github.com/windmilleng/wat/os/sysctl 70 go test github.com/windmilleng/wat/cli/dirs 71 -------------------- 72 $ go test github.com/windmilleng/wat/data/db/dbpath 73 ok github.com/windmilleng/wat/data/db/dbpath 74 -------------------- 75 $ go test github.com/windmilleng/wat/os/sysctl 76 ok github.com/windmilleng/wat/os/sysctl 77 -------------------- 78 $ go test github.com/windmilleng/wat/cli/dirs 79 ok github.com/windmilleng/wat/cli/dirs 80 ``` 81 82 You can also explicitly kick off training with: 83 ``` 84 wat train 85 ``` 86 87 ## Supported Languages 88 89 `wat` supports: 90 91 - Go 92 - JavaScript (with package.json) 93 - Python (with `pytest`) 94 95 We welcome contributions to add more language detection! 96 97 98 ## Privacy 99 100 This tool can send usage reports to https://events.windmill.build, to help us 101 understand what features people use. We only report on which `wat` commands 102 run and how long they run for. 103 104 You can enable usage reports by running 105 106 ``` 107 wat analytics opt in 108 ``` 109 110 (and disable them by running `wat analytics opt out`.) 111 112 We do not report any personally identifiable information. We do not report any 113 identifiable data about your code. 114 115 We do not share this data with anyone who is not an employee of Windmill 116 Engineering. Data may be sent to third-party service providers like Datadog, 117 but only to help us analyze the data. 118 119 ## License 120 Copyright 2018 Windmill Engineering 121 122 Licensed under [the Apache License, Version 2.0](LICENSE)