Commit Graph

191 Commits

Author SHA1 Message Date
Jacob Hoffman-Andrews 1014a81606 Switch to modules (#4211)
Because the package versions in go.mod match what we use in Godeps.json,
there are no substantive code diffs. However, there are some tiny
differences resulting from how go mod vendors things differently than
godep:

go mod does not preserve executable permissions on shell scripts
Some packages have import lines like:
package ocsp // import "golang.org/x/crypto/ocsp"

godep used to remove the comment from these lines, but go mod vendor does not.

This introduces several indirect dependencies that we didn't have
before. This is because godep used to operate at a package level, but
go mod operates at a module (~= repository) level. So if we used a
given repository, but didn't use all of its packages, we wouldn't
previously care about the transitive dependencies of the packages we
weren't using. However, in the go mod world, once we care about the
repository, we care about all of that repository's transitive
dependencies. AFAICT this doesn't affect vendoring.

Fixes #4116
2019-05-23 14:14:00 -07:00
Jacob Hoffman-Andrews 0d2e41fdc8 Bring back errcheck, accidentally removed from tests. (#4212) 2019-05-14 17:07:03 -04:00
Daniel McCarney 484669efb0
tests: allow skipping load testing during int. tests. (#4168)
Adds plumbing in `test.sh` to modify whether the `--load` argument is
provided to `test/integration-test.py`. Use `-e INT_SKIP_LOAD=true` with
`docker-compose run ... ./test.sh` to skip load generation.
2019-04-18 16:25:05 -04:00
Jacob Hoffman-Andrews e8aea434f4
Test cleanups: pipefail and one lint phase (#4156)
The `set` builtin needs to have a `-o` flag before `pipefail` to
actually set that option. Without `-o`, `pipefail` was ignored.

Also, we had a number of test phases that ran various types of linters,
all of them fast. This moves them all together in a single test phase
to make things easier to read, and to ensure they all run before
the integration and unit tests.
2019-04-16 10:14:32 -07:00
Jacob Hoffman-Andrews 1a59eabb2d Simplify test.sh. (#4151)
Instead of tracking failure status and using the `run` function, just
use the traditional `set -ex pipefail`. This makes the whole thing exit
immediately if any command fails.

Also remove the "contexts" notion and the unused $GOTESTFLAGS variable.

Simplify the gofmt check significantly.

Remove obsolete `sed` for cleaning up after gomock.

Use inefassign's recursion to discover files, and don't bother with run_and_expect_silence.
It will exit 1 on error.

Install grpc codes package from vendor. Without that change it was failing to install.
2019-04-10 09:41:39 -07:00
Jacob Hoffman-Andrews d2d5f0a328 Update miekg/dns and golang/protobuf. (#4150)
Precursor to #4116. Since some of our dependencies impose a minimum
version on these two packages higher than what we have in Godeps, we'll
have to bump them anyhow. Bumping them independently of the modules
update should keep things a little simpler.

In order to get protobuf tests to pass, I had to update protoc-gen-go in
boulder-tools. Now we download a prebuilt binary instead of using the
Ubuntu package, which is stuck on 3.0.0. This also meant I needed to
re-generate our pb.go files, since the new version generates somewhat
different output.

This happens to change the tag for pbutil, but it's not a substantive change - they just added a tagged version where there was none.

$ go test github.com/miekg/dns/...
ok      github.com/miekg/dns    4.675s
ok      github.com/miekg/dns/dnsutil    0.003s

ok      github.com/golang/protobuf/descriptor   (cached)
ok      github.com/golang/protobuf/jsonpb       (cached)
?       github.com/golang/protobuf/jsonpb/jsonpb_test_proto     [no test files]
ok      github.com/golang/protobuf/proto        (cached)
?       github.com/golang/protobuf/proto/proto3_proto   [no test files]
?       github.com/golang/protobuf/proto/test_proto     [no test files]
ok      github.com/golang/protobuf/protoc-gen-go        (cached)
?       github.com/golang/protobuf/protoc-gen-go/descriptor     [no test files]
ok      github.com/golang/protobuf/protoc-gen-go/generator      (cached)
ok      github.com/golang/protobuf/protoc-gen-go/generator/internal/remap       (cached)
?       github.com/golang/protobuf/protoc-gen-go/grpc   [no test files]
?       github.com/golang/protobuf/protoc-gen-go/plugin [no test files]
ok      github.com/golang/protobuf/ptypes       (cached)
?       github.com/golang/protobuf/ptypes/any   [no test files]
?       github.com/golang/protobuf/ptypes/duration      [no test files]
?       github.com/golang/protobuf/ptypes/empty [no test files]
?       github.com/golang/protobuf/ptypes/struct        [no test files]
?       github.com/golang/protobuf/ptypes/timestamp     [no test files]
?       github.com/golang/protobuf/ptypes/wrappers      [no test files]
2019-04-09 09:27:28 -07:00
Daniel McCarney b99b35009e load-generator: support all challenge types, run in CI. (#4140)
## CI: restore load-generator run.

This restores running the `load-generator` during CI to make sure it doesn't bitrot. It was previously removed while we debugged the VA getting jammed up and not cleanly shutting down.

Since the global `pebble-challtestsrv` and the `load-generator`'s internal chall test srv will conflict this requires moving the `load-generator` run to the end of integration tests and updating `startservers.py` to allow the load gen integration test code to stop the `pebble-challtestsrv` before starting the `load-generator`.

The `load-generator` and associated config are updated to allow specifying bind addresses for the DNS interface of the internal challtestsrv. Multiple addresses are supported so that the `load-generator`'s chall test srv can listen on port DNS ports Boulder is configured to use. The `load-generator` config now accepts a `fakeDNS` parameter that can be used to specify the default IPv4 address returned by the `load-generator`'s DNS server for A queries.

## load-generator: support different challenges/strategies.

Updates the load-generator to support HTTP-01, DNS-01, and TLS-ALPN-01 challenge response servers. A new challenge selection configuration parameter (`ChallengeStrategy`) can be set to `"http-01"`, `"dns-01"`, or `"tls-alpn-01"` to solve only challenges of that type. Using `"random"` will let the load-generator choose a challenge type randomly.

Resolves https://github.com/letsencrypt/boulder/issues/3900
2019-04-04 11:44:14 -07:00
Daniel McCarney 57fc8a4a4c CI: remove Go 1.11.x (#4112)
We're officially on 1.12 in prod/staging and can deprecate the 1.11.x builds/tests in CI.
2019-03-14 12:03:30 -07:00
Jacob Hoffman-Andrews 2f6626afca Add Go 1.12 to Travis. (#4097)
* Add Go 1.12 to Travis.
* Update tag date.
* Fix go vet.
2019-03-06 16:45:11 -05:00
Roland Bracewell Shoemaker a6a00cb2ee Add ineffassign to CI tests (#4056) 2019-02-14 09:47:16 -05:00
Roland Bracewell Shoemaker 142ff9c075 Allow integration test filter pass through and skipping integration setup (#3954)
Fixes #3943.
2018-11-28 16:15:33 -08:00
Daniel McCarney 3319246a97 Dev/CI: Add Go 1.11.1 builds (#3888)
Resolves https://github.com/letsencrypt/boulder/issues/3872

**Note to reviewers**: There's an outstanding bug that I've tracked down to the `--load` stage of the integration tests that results in one of the remote VA instances in the `test/config-next` configuration under Go 1.11.1 to fail to cleanly shut down. I'm working on finding the root cause but in the meantime I've disabled `--load` during CI so we can unblock moving forward with getting Go 1.11.1 in dev/CI. Tracking this in https://github.com/letsencrypt/boulder/issues/3889
2018-10-19 09:38:20 -07:00
Daniel McCarney 0306a933ac CI: Ignore Godeps 'Comment' fields in godep-restore. (#3744)
In preparation of `vgo` it seems many upstream projects are adding new
tags. This is causing variations in the `godep-restore` phase of CI when
the CI Godeps picks up a new `Comment` field that isn't present in the
committed JSON. This has broken master ~3 times now and so it seems
prudent to ignore the Comment field entirely for the short term. We
continue to wait for the glorious day in which we can switch to `vgo`
and never muck with `Godeps.json` again.
2018-06-04 08:34:52 -07:00
Jacob Hoffman-Andrews b8e42cfbdf Update to latest boulder-tools. (#3734)
* Update to latest boulder-tools.

* Add Fprint* to errcheck ignore.
2018-05-29 08:58:44 -04:00
Jacob Hoffman-Andrews 7227279b5f
Remove TESTPATHS and others from test.sh (#3669)
Prior to Go 1.9 (https://golang.org/doc/go1.9),
various go commands would expand "./..." to include vendor directories.
We worked around this by listing "./..." then grepping out vendor. Now
that we are on Go 1.10 this is no longer necessary. Remove the TESTPATHS
hack.

We still need to exclude certain test directories when running errcheck,
so some of the "go list" logic gets moved into the errcheck stanza.

Also, as of Go 1.10, running coverage on multiple packages in one run is
supported, so replace the "for" loop in the coverage stanza with a
single command.

Also, remove GITHUB_SECRET_FILE and "die," both of which were unused.
2018-04-26 10:39:13 -07:00
Jacob Hoffman-Andrews 268d9b1491 Run v2 integration tests as part of v1 tests. (#3569)
- Remove acme-v2 test phase.
- Rename integration-test-v2.py to v2_integration, so it can be imported.
- Import all symbols from v2_integration before running test_*.
- In chisel2:
  - Rename DIRECTORY so it doesn't collide.
  - Incidental logging and error fixes.
- Merge v1 and v2 load testing into a single function.
- Run cert-checker just once, after all other test cases.
- In v2_integration:
  - Remove unnecessary imports.
  - Import chisel2 methods in the chisel2 namespace so they don't
    collide with chisel methods.
  - Remove main and shutdown code.
2018-03-19 10:19:02 -04:00
Daniel McCarney 531d9ce52c
Run load-generator against V1 and V2 API in CI. (#3509)
This commit adds short 15s runs of the load generator against the V1 and
V2 APIs during the three integration test runs (v1 config, v1
config-next, and v2). 15s was selected because 30s caused too much
output and the build log to be truncated.

Presently the latency output is *not* being checked for errors. This was
too flaky in practice.

A fix for a race condition in the load-generator code itself related to
HTTP status code tracking is included in this commit.

The pending authz rate limit also needed to be adjusted to keep the
load-generator from failing requests after hitting 429s.
2018-03-05 15:34:15 -05:00
Jacob Hoffman-Andrews 6b8b6a37c0 Update chisel2 and boulder-tools (#3495)
This change updates boulder-tools to use Go 1.10, and references a
newly-pushed image built using that new config.

Since boulder-tools pulls in the latest Certbot master at the time of
build, this also pulls in the latest changes to Certbot's acme module,
which now supports ACME v2. This means we no longer have to check out
the special acme-v2-integration branch in our integration tests.

This also updates chisel2.py to reflect some of the API changes that
landed in the acme module as it was merged to master.

Since we don't need additional checkouts to get the ACMEv2-compatible
version of the acme module, we can include it in the default RUN set for
local tests.
2018-02-28 15:21:40 -08:00
Jacob Hoffman-Andrews f730abd32c Verify SSL by default in chisel. (#3449)
chisel had verify_ssl=False. Remove that, and set a sensible default
for REQUESTS_CA_BUNDLE to make it easier to run chisel on the command
line. Port the REQUESTS_CA_BUNDLE change into chisel2 as well.
2018-02-15 08:36:04 -05:00
Jacob Hoffman-Andrews 827f7859f2 Fix issuerCert in test configs. (#3310)
Previously, there was a disagreement between WFE and CA as to what the correct
issuer certificate was. Consolidate on test-ca2.pem (h2ppy h2cker fake CA).
    
Also, the CA configs contained an outdated entry for "IssuerCert", which was not
being used: The CA configs now use an "Issuers" array to allow signing by
multiple issuer certificates at once (for instance when rolling intermediates).
Removed this outdated entry, and the config code for CA to load it. I've
confirmed these changes match what is currently in production.

Added an integration test to check for this problem in the future.

Fixes #3309, thanks to @icing for bringing the issue to our attention!

This also includes changes from #3321 to clarify certificates for WFE.
2018-01-09 07:56:39 -05:00
Jacob Hoffman-Andrews b369818ad6 Integration test for ACMEv2 (#3298) 2017-12-21 13:27:32 -05:00
Jacob Hoffman-Andrews 5f0cbddd9d Check for unnecessary godeps (#3206)
Fixes https://github.com/letsencrypt/boulder/issues/3205.

Previously, we would only move aside Godeps.json before running `godep save ./...`. However, in order to get a true picture of what is needed, we must also remove the existing `vendor/` directory.

This change also removes some unnecessary dependencies that have piled up over the years, generally test dependencies. Godep used to vendor such dependencies but no longer does.
2017-11-03 14:30:07 -04:00
Daniel McCarney 84d6a35b1e Restore `run_and_expect_silence` for `godep save`. (#3055) 2017-09-07 11:40:48 -07:00
Roland Bracewell Shoemaker 09c4c1e24e Properly validate punycode (#2964)
Godep apparently breaks when trying to parse code that specifies build tags for versions of golang above that with which it was built (which it shouldn't be parsing in the first place). This breaks the travis tests since `golang.org/x/net/context` now contains golang 1.9 specific code. In order to get around this we temporarily disable the error check for `godep save ./...` in test.sh. Opened #2965 to revert this once Godep is fixed or we move to golang 1.9.

Requires an update to `golang.org/x/net` and adding `golang.org/x/text`.

```
[roland@niya:~/gopath/src/golang.org/x/net]$ go test ./...
ok  	golang.org/x/net/bpf	0.472s
ok  	golang.org/x/net/context	0.090s
ok  	golang.org/x/net/context/ctxhttp	0.161s
?   	golang.org/x/net/dict	[no test files]
ok  	golang.org/x/net/dns/dnsmessage	0.044s
ok  	golang.org/x/net/html	0.094s
ok  	golang.org/x/net/html/atom	0.003s
ok  	golang.org/x/net/html/charset	0.027s
ok  	golang.org/x/net/http2	80.253s
?   	golang.org/x/net/http2/h2i	[no test files]
ok  	golang.org/x/net/http2/hpack	0.064s
ok	golang.org/x/net/icmp	0.026s
ok  	golang.org/x/net/idna	0.035s
?   	golang.org/x/net/internal/iana	[no test files]
?   	golang.org/x/net/internal/nettest	[no test files]
ok  	golang.org/x/net/internal/socket	0.005s
ok  	golang.org/x/net/internal/timeseries	0.024s
ok  	golang.org/x/net/ipv4	0.013s
ok  	golang.org/x/net/ipv6	0.036s
ok  	golang.org/x/net/lex/httplex	0.004s
ok  	golang.org/x/net/nettest	1.164s
ok  	golang.org/x/net/netutil	0.898s
ok  	golang.org/x/net/proxy	0.004s
ok  	golang.org/x/net/publicsuffix	0.202s
ok  	golang.org/x/net/trace	0.018s
ok  	golang.org/x/net/webdav	0.061s
ok  	golang.org/x/net/webdav/internal/xml	0.014s
ok  	golang.org/x/net/websocket	0.022s
ok  	golang.org/x/net/xsrftoken	0.025s

[roland@niya:~/gopath/src/golang.org/x/text]$ go test ./...
?   	golang.org/x/text	[no test files]
ok  	golang.org/x/text/cases	0.439s
?   	golang.org/x/text/cmd/gotext	[no test files]
ok  	golang.org/x/text/collate	0.038s
ok  	golang.org/x/text/collate/build	0.024s
?   	golang.org/x/text/collate/tools/colcmp	[no test files]
ok  	golang.org/x/text/currency	2.961s
ok  	golang.org/x/text/encoding	0.005s
ok  	golang.org/x/text/encoding/charmap	0.060s
ok  	golang.org/x/text/encoding/htmlindex	0.005s
ok  	golang.org/x/text/encoding/ianaindex	0.030s
?   	golang.org/x/text/encoding/internal	[no test files]
?   	golang.org/x/text/encoding/internal/enctest	[no test files]
?   	golang.org/x/text/encoding/internal/identifier	[no test files]
ok  	golang.org/x/text/encoding/japanese	0.098s
ok  	golang.org/x/text/encoding/korean	0.032s
ok  	golang.org/x/text/encoding/simplifiedchinese	0.100s
ok  	golang.org/x/text/encoding/traditionalchinese	0.012s
ok  	golang.org/x/text/encoding/unicode	0.013s
ok  	golang.org/x/text/encoding/unicode/utf32	0.071s
ok  	golang.org/x/text/feature/plural	0.352s
ok  	golang.org/x/text/internal	0.009s
ok  	golang.org/x/text/internal/catmsg	0.034s
ok  	golang.org/x/text/internal/colltab	1.817s
ok  	golang.org/x/text/internal/export/idna	0.040s
?   	golang.org/x/text/internal/format	[no test files]
?   	golang.org/x/text/internal/gen	[no test files]
ok  	golang.org/x/text/internal/number	0.028s
ok  	golang.org/x/text/internal/stringset	0.021s
ok  	golang.org/x/text/internal/tag	0.044s
?   	golang.org/x/text/internal/testtext	[no test files]
ok  	golang.org/x/text/internal/triegen	0.357s
ok  	golang.org/x/text/internal/ucd	0.023s
?   	golang.org/x/text/internal/utf8internal	[no test files]
ok  	golang.org/x/text/language	0.033s
ok  	golang.org/x/text/language/display	3.917s
ok  	golang.org/x/text/message	0.033s
ok  	golang.org/x/text/message/catalog	0.069s
ok  	golang.org/x/text/runes	0.039s
ok  	golang.org/x/text/search	0.019s
?   	golang.org/x/text/secure	[no test files]
ok  	golang.org/x/text/secure/bidirule	0.032s
ok  	golang.org/x/text/secure/precis	0.066s
ok  	golang.org/x/text/transform	0.106s
?   	golang.org/x/text/unicode	[no test files]
ok  	golang.org/x/text/unicode/bidi	0.026s
ok  	golang.org/x/text/unicode/cldr	0.114s
ok  	golang.org/x/text/unicode/norm	4.009s
ok  	golang.org/x/text/unicode/rangetable	1.516s
ok  	golang.org/x/text/unicode/runenames	0.011s
ok  	golang.org/x/text/width	0.310s
```

Fixes #2963.
2017-08-10 16:22:11 -04:00
Jacob Hoffman-Andrews 9c7482fa94 Remove error return from Scope interface. (#2857)
This was inherited from the statsd interface but never used. This allows us to
remove one of our errcheck exceptions.
2017-07-11 10:54:06 -07:00
Jacob Hoffman-Andrews d5d8b0dba8 Grafana dashboard update. (#2786)
- Add OCSP graphs
- Graph overall request rate
- Separate out WFE vs OCSP graphs
- Fix challenge graph (add a / to endpoint)
- Some incidental changes to "step"
- Add a lint script to check for common dashboard mistakes
2017-05-26 10:53:43 -04:00
Daniel McCarney e1bff721a7 Fixes master's unit tests, test failure. (#2763)
* Fixes post-merge artifact breaking VA unit tests.

* Fixes CI unit tests to fail build if tests fail.
2017-05-15 14:33:31 -04:00
Jacob Hoffman-Andrews b17b5c72a6 Remove statsd from Boulder (#2752)
This removes the config and code to output to statsd.

- Change `cmd.StatsAndLogging` to output a `Scope`, not a `Statter`.
- Remove the prefixing of component name (e.g. "VA") in front of stats; this was stripped by `autoProm` but now no longer needs to be.
- Delete vendored statsd client.
- Delete `MockStatter` (generated by gomock) and `mocks.Statter` (hand generated) in favor of mocking `metrics.Scope`, which is the interface we now use everywhere.
- Remove a few unused methods on `metrics.Scope`, and update its generated mock.
- Refactor `autoProm` and add `autoRegisterer`, which can be included in a `metrics.Scope`, avoiding global state. `autoProm` now registers everything with the `prometheus.Registerer` it is given.
- Change va_test.go's `setup()` to not return a stats object; instead the individual tests that care about stats override `va.stats` directly.

Fixes #2639, #2733.
2017-05-15 10:19:54 -04:00
Daniel McCarney 1e57de2a00 Removes "coverage" from default RUN. (#2750)
Having "coverage" in the default RUN is leaving ".coverprofile" files
all over the src tree. This commit removes this task from the default
RUN list for local work. It is included in travis.yml and will still run
for CI or when specified explicitly with a command line env var
  override.
2017-05-11 10:38:22 -04:00
Daniel McCarney 40663ba66c Fixes test speeds by splitting `-race` from coverage runs. (#2721)
The unit test runs in CI have been taking ~20 minutes. The root cause is
using `-race` on every individual `go test` invocation. We can't switch
to one big `go test` with `-race` instead of individuals if we want test
coverage to be reported. The workaround is to do one big `go test` with
`-race` first, and then many individual `go test`'s to collect coverage
*without* `-race`. This is still faster overall than the current state
of affairs.

Resolves https://github.com/letsencrypt/boulder/issues/2695
2017-05-02 14:57:32 -07:00
Jacob Hoffman-Andrews 1b994083ba Use latest Certbot in boulder-tools. (#2554)
This allows us to iterate more easily against the current acme module.

Also, remove nodejs from boulder-tools, clean up a few packages that weren't
previously cleaned up, and install a specific version of protoc-gen-go to match
our vendored grpc.
2017-02-09 16:10:01 -08:00
Jacob Hoffman-Andrews 7705b18a70 Refactor integration test.
Add a new tiny client called chisel, in place of test.js. This reduces the
number of language runtimes Boulder depends on for its tests. Also, since chisel
uses the acme Python library, we get more testing of that library, which
underlies Certbot. This also gives us more flexibility to hook different parts
of the issuance flows in our tests.

Reorganize integration-test.py itself. There was not clear separation of
specific test cases. Some test cases were added as part of run_node_test; some
were wrapped around it. There is now much closer to one function per test case.
Eventually we may be able to adopt Python's test infrastructure for these test
cases.

Remove some unused imports; consolidate on urllib2 instead of urllib.

For getting serial number and expiration date, replace shelling out to OpenSSL
with using pyOpenSSL, since we already have an in-memory parsed certificate.

Replace ISSUANCE_FAILED, REVOCATION_FAILED, MAILER_FAILED with simple die, since
we don't use these. Later, I'd like to remove the other specific exit codes. We
don't make very good use of them, and it would be more effective to just use
stack traces or, even better, reporting of which test cases failed.

Make single_ocsp_sign responsible for its own subprocess lifecycle.

Skip running startservers if WFE is already running, to make it easier to
iterate against a running Boulder (saves a few seconds of Boulder startup).
2017-01-22 20:51:27 -08:00
Jacob Hoffman-Andrews b22cae8cdd Don't echo command from run_and_expect_silence. (#2405)
Some commands, like our errcheck command, are very long. When we echo these both
before and after running them, it can obscure what is often a single-line
failure message. Removing the echo after failure makes it easier to spot the
real failure message.
2016-12-08 11:22:21 -08:00
Daniel McCarney a2b8faea1e Only resubmit missing SCTs. (#2342)
This PR introduces the ability for the ocsp-updater to only resubmit certificates to logs that we are missing SCTs from. Prior to this commit when a certificate was missing one or more SCTs we would submit it to every log, causing unnecessary overhead for us and the log operator.

To accomplish this a new RPC endpoint is added to the Publisher service "SubmitToSingleCT". Unlike the existing "SubmitToCT" this RPC endpoint accepts a log URI and public key in addition to the certificate DER bytes. The certificate is submitted directly to that log, and a cache of constructed resources is maintained so that subsequent submissions to the same log can reuse the stat name, verifier, and submission client.

Resolves #1679
2016-12-05 13:54:02 -08:00
Jacob Hoffman-Andrews 070114a2e4 Check out a specific tag for Certbot integration tests. 2016-10-11 15:00:55 -07:00
Daniel McCarney 343c8a2465 Allows setting `$TESTPATHS` external to `test.sh`. (#2201)
Unlike the `$GOTESTFLAGS` var there was no way to pass in a default
value to `test.sh` via `docker-compose -e` to indicate you only want to
run specific unit tests.

This commit puts the default `$TESTPATHS` into `$DEFAULT_TESTPATHS` and
assigns it to `$TESTPATHS` only if there isn't already a `$TESTPATHS`
value provided.

Example usage, running just the SA unit tests, with the "next" config,
using `-race -v`:

```
  docker-compose run -e BOULDER_CONFIG_DIR="test/config-next"
    -e RUN="unit" -e GOTESTFLAGS="-v -race"
    -e TESTPATHS="github.com/letsencrypt/boulder/sa" boulder ./test.sh
```
2016-09-27 10:33:44 -07:00
Blake Griffith 45bb14a31c Just pull the tip of certbot to save bandwidth. (#2146)
Changes the `test.sh` certbot git clone to use `--depth=1`. Prior to this commit the clone cost ~11 MiB. It now it costs ~784 KiB.
2016-09-06 10:25:34 -04:00
Jacob Hoffman-Andrews 21ecdc2008 Tidy up test.sh. (#2108)
Remove the code that echoes exit status on integration failure. It was buggy and
would always print 0, which was confusing. Instead, use `run`.

Rename run_and_comment to run_and_expect_silence, since it doesn't comment
anymore.
2016-08-08 11:54:54 -07:00
Roland Bracewell Shoemaker e3266a1684 Switch to Golang 1.6.3 (#2105)
* Switch to golang 1.6

* Update docker image references

* Update godep major version

* Remove GO15VENDOREXPERIMENT references

* Fix errcheck ignore path
2016-08-05 16:35:43 -04:00
Daniel McCarney 2a89063fce Create rpm during CI run. (#2087)
This PR modifies the `test.sh` script to allow a `rpm` value in the `RUN` parameter passed to the script via the environment. When present, `make rpm` is invoked and a good status is required for the build to pass.

The `Makefile` was modified to add a `-f` to the `fpm` invocation used by the `rpm` build task to allow the output rpm to be overwritten if present. Otherwise multiple runs of identical bulld (e.g. on a local dev machine) would collide on the .rpm already being present.

Finally `.travis.yml` is updated to include `rpm` in the `RUN` used during CI such that an RPM is built by default for CI runs. I left the default `RUN` in `test.sh` unmodified, so an RPM will not be built for local runs (e.g. `docker-compose run boulder ./test.sh`).

This fixes #2085
2016-07-26 18:00:36 -04:00
Daniel McCarney 72b65d82c5 Update certbot tests (#2027)
This PR changes the `certbot` integration tests that are run from the `0.8.0` release to master.

Note: this is only updating the *tests* that are run. We continue to invoke the `certbot` binary that is installed from jessie-backports as part of the `boulder-tools` image.

This fixes #2021
2016-07-08 14:34:45 -04:00
Jacob Hoffman-Andrews fd095b8881 Fix Docker test builds: latest certbot and grpc (#1991)
The `letsencrypt/boulder-tools` image was recently updated, pulling in version
0.8.0 of certbot. That version stores the output of `certonly` requests in a
different path. In test.sh, we check out a specific tagged release of certbot in
order to get its integration tests. Prior to this commit, we were using
certbot 0.8.0 with the integration tests from version 0.6.0 of certbot,
which looked for `certonly` output in the wrong place, and failed.

This commit changes test.sh to checkout the 0.8.0 branch, and also removes a
temporary shim we used to make the `certbot` command call out to the
`letsencrypt` command.

Also, since the latest version of `letsencrypt/boulder-tools` includes an updated
`protoc-gen-go`, this change also updates the support packages to match.
2016-06-29 10:54:03 -07:00
Jacob Hoffman-Andrews 567bc8027a Remove existence check for gover and goveralls. (#1850)
Since they are only run inside an "if Travis" block, and we know those tools are
installed in the Docker image we use on Travis. This restores coverage reporting
to our builds.

https://github.com/letsencrypt/boulder/pull/1850
2016-05-27 10:05:11 -07:00
bmw 09de6dd4b1 Check out last certbot release (#1845)
Hack to fix integration test failures
2016-05-25 18:32:12 -07:00
Jacob Hoffman-Andrews 71e4af43f7 Roll forward "Run Travis tests in Docker (#1830)" (#1838)
That change broke the certbot tests because it switched to a MariaDB
10.1-specific syntax. certbot/certbot#3058 changes the certbot tests to use
Boulder's docker-compose.yml, so they will get MariaDB 10.1 automatically.
2016-05-24 15:11:22 -07:00
Jacob Hoffman-Andrews b954dcc010 Revert "Run Travis tests in Docker (#1830)" (#1834)
This reverts commit 92d94f2 and commit 0b4623f to unbreak the Certbot build.
2016-05-20 15:57:10 -07:00
Jacob Hoffman-Andrews 92d94f2558 Run Travis tests in Docker (#1830)
* MariaDB 10.1

* MariaDB 10.1 in Docker

* Run docker stuff.

* Improve test.js error.

* Lower log level

* Revert dockerfile to master

* Export debug ports, set FAKE_DNS, and remove container_name.

* Remove typo.

* Make integration-test.py wait for debug ports.

* Use 10.1 and export more Boulder ports.

* Test updates for Docker

Listen on 0.0.0.0 for utility servers.
Make integration-test.py just wait for ports rather than calling startservers.
Run docker-compose in test.sh.
Remove bypass when database exists.
Separate mailer test into its own function in integration test.
Print better errors in test.js.

* Always bring up mysql container.

* Wait for MySQL to come up.

* Put it in travis-before-install.

* Use 127

* Remove manual docker-up.

* Add ifconfig

* Switch to docker-compose run

* It works!

* Remove some spurious env vars.

* Add bash

* try running it

* Add all deps.

* Pass through env.

* Install everything in the Dockerfile.

* Fix install of ruby

* More improvements

* Revert integration test to run directly
Also remove .git from dockerignore and add some packages.

* Revert integration-test.py to master.

* Stop ignoring test/js

* Start from boulder-tools.

* Add boulder-tools.

* Tweak travis.yml

* Separate out docker-compose pull as install.

* Build in install phase; don't bother with go install in Dockerfile

* Add virtualenv

* Actually build rabbitmq-setup

* Remove FAKE_DNS

* Trivial change

* Pull boulder-tools as a separate step so it gets its own timing info.

* Install certbot and protobuf from repos.

* Use cerbot from debian backports.

* Fix clone

* Remove CERTBOT_PATH

* Updates

* Go back to letsencrypt for build.sh

* Remove certbot volume.

* go back to preinstalled letsencrypt

* Restore ENV

* Remove BASH_ENV

* Adapt reloader test so it psses when run as root.

* Fixups for review.

* Revert test.js

* Revert startservers.py

* Revert Makefile.
2016-05-19 16:29:45 -07:00
Jacob Hoffman-Andrews e45cd826f7 Remove github-pr-status in test.sh. (#1827) 2016-05-16 17:51:21 -07:00
Jacob Hoffman-Andrews 4e60e4bb59 Restore testing of godep restore. (#1821)
PR #1808 accidentally removed the main diff.
Also, leave out diffing of Godeps in the `go generate` test.

https://github.com/letsencrypt/boulder/pull/1821
2016-05-14 22:03:47 +02:00
Roland Bracewell Shoemaker 28f851c375 Strip out Godep version before diffing Godeps.json (#1808)
This means our tests won't break when the Godep version is increased.
2016-05-12 17:43:46 -07:00
Jacob Hoffman-Andrews 7208052ad6 Change paths to match certbot renaming. (#1792) 2016-05-06 15:57:07 -07:00
Jacob Hoffman-Andrews f776343d4e Remove forked repo godep restore exception. (#1786) 2016-05-05 11:22:17 -07:00
Jacob Hoffman-Andrews 702a0dbb0c Hard-fail godep-restore. (#1767) 2016-04-25 11:49:34 -07:00
Jacob Hoffman-Andrews 6d5348f975 Run go generate in Travis (#1762)
* Fix go generate command in metrics.

The previous command only worked on OS X. This one works on Linux but not
OS X.

Also add generate phase of test.sh.

* Add mockgen to test setup.

* Fix github-pr-status output.

* Fix envvar style.

* Set xtrace.

* Fix test.sh

* Fix test.sh some more.

* Fix mockgen command.

* Add dependencies for running `go generate`.

* Add protoc-gen-go.

* Fix go get command.

* Fix generate.

* Wait for all.

* Fix generate.

* Update generated pb.

* Fix generate commands for vendored world.

* Update documentation for new vendor style.

* Update grpc package to latest.

* Update caaChecker proto with latest.

* Run go generate only over TESTPATHS

* See if Travis passes under 1.6

* Switch back to 1.5.

* Trim run command.

* Run stringer from correct directory.

* Move generate command.

* Restore and generate

* Fix path.

* list contents of GOPATH.

* Fix stringer by prebuilding.

* Try another import path.

* regenerate bcode_string.

* remove excess package

* pull jsha fork of protoc-gen-go that echoes

* Echo protoc version.

* install from source

* CD back.

* Go back to normal protoc-gen-go

* Fix path

* Move protobuf install into test/setup.sh

* Move before_install to install.

* Set PATH.

* Follow 301 with curl.

* Shuffle test order.

* Swap back test order.

* Restore all tests.

* Restore 1.5.3 to Travis.

* Remove unnecessary wait-or-exit

* Generate metrics mock with latest mockgen.

* Wrap TESTPATHS in curlies

* Remove spurious bracket
2016-04-21 15:23:06 -07:00
bmw ea52c2130b Use tools/venv.sh from client repo in integration tests (#1752) 2016-04-18 16:50:26 -07:00
Jacob Hoffman-Andrews e6c17e1717 Switch to new vendor style (#1747)
* Switch to new vendor style.

* Fix metrics generate command.

* Fix miekg/dns types_generate.

* Use generated copies of files.

* Update miekg to latest.

Fixes a problem with `go generate`.

* Set GO15VENDOREXPERIMENT.

* Build in letsencrypt/boulder.

* fix travis more.

* Exclude vendor instead of godeps.

* Replace some ...

* Fix unformatted cmd

* Fix errcheck for vendorexp

* Add GO15VENDOREXPERIMENT to Makefile.

* Temp disable errcheck.

* Restore master fetch.

* Restore errcheck.

* Build with 1.6 also.

* Match statsd.*"

* Skip errcheck unles Go1.6.

* Add other ignorepkg.

* Fix errcheck.

* move errcheck

* Remove go1.6 requirement.

* Put godep-restore with errcheck.

* Remove go1.6 dep.

* Revert master fetch revert.

* Remove -r flag from godep save.

* Set GO15VENDOREXPERIMENT in Dockerfile and remove _worskpace.

* Fix Godep version.
2016-04-18 12:51:36 -07:00
bmw e2e5e05766 Update client package names for integration tests (#1740) 2016-04-15 12:20:56 -07:00
Roland Bracewell Shoemaker 8eaf247ee9 Split CAA checking out to its own service (#1647)
* Split out CAA checking service (minus logging etc)
* Add example.yml config + follow general Boulder style
* Update protobuf package to correct version
* Add grpc client to va
* Add TLS authentication in both directions for CAA client/server
* Remove go lint check
* Add bcodes package listing custom codes for Boulder
* Add very basic (pull-only) gRPC metrics to VA + caa-service
2016-04-12 23:02:41 -07:00
Kane York 25b45a45ec Errcheck errors fixed (#1677)
* Fix all errcheck errors
* Add errcheck to test.sh
* Add a new sa.Rollback method to make handling errors in rollbacks easier.
This also causes a behavior change in the VA. If a HTTP connection is
abruptly closed after serving the headers for a non-200 response, the
reported error will be the read failure instead of the non-200.
2016-04-12 16:54:01 -07:00
Jacob Hoffman-Andrews 0a627dd74b Suppress noise on running unittests.
Remove -v for go install.

Don't print success after every successful command.

Remove `run` in front of `go test` to avoid printing each command.

This reduces the number of log lines taken by successful unittests in Travis by
66%, and makes failures much more visible and easy to read.
2016-04-05 17:35:07 -07:00
Jacob Hoffman-Andrews 7fe78676b6 Improve how we test godep restore. 2016-03-20 17:23:15 -07:00
Roland Bracewell Shoemaker 736376173a Merge branch 'master' into test-linear 2016-02-16 14:41:04 -08:00
Jacob Hoffman-Andrews 8f8e89b571 Add a 'godep restore' test in Travis.
This ensures our godeps match the remote repo.
2016-02-16 12:57:19 -08:00
Jacob Hoffman-Andrews 009ed1c4f5 Run unittests in serial.
Fixes spurious local failures.
2016-02-16 12:57:03 -08:00
Jacob Hoffman-Andrews 33b8c357ef Split out setup.sh from travis-before-install.
This accomplishes two things:
 - setup.sh should now be usable by the client integration test.
 - setup.sh can be used by new project members to simplify first setup.

Update the README to indicate the new file, and to correct some out-of-date
information.
2015-11-30 23:44:45 -08:00
Jacob Hoffman-Andrews 02d5aa5831 Integration test fixes
In https://github.com/letsencrypt/boulder/pull/1110 we put
the activate command in the wrong place so it didn't run if
LETSENCRYPT_PATH was set.

Also remove SIMPLE_HTTP_PORT which is no longer necessary. It was used to keep
the build passing as the client transitioned ports. The client now defaults to
5002.
2015-11-11 13:43:46 -08:00
Jeff Hodges 3df0592b15 move sourcing of activate into test.sh
This gets us closer to allowing the client repo to use
integration-test.py. They have a different path without "venv" in it for
their virtualenv set up.

Updates #1101
2015-11-06 18:11:06 -08:00
Jeff Hodges 0af66a2080 rename amqp-integration-test.py
Make it integration-test.py

Depends on #1102, so please review that first.

Updates #1101 (it's the second step).
2015-11-06 16:31:36 -08:00
Jeff Hodges 62489a6ba9 add skipping of node or letsencrypt integration
Updates #1101
2015-11-06 14:06:07 -08:00
Jeff Hodges e8cd5c1fdd fix integration by changing pip install
The letsencrypt repo renamed its requirements.txt and I'm told we don't
actually need to use it.

Fixes #1105
2015-11-05 21:53:59 -08:00
Jacob Hoffman-Andrews f1103cb094 Fix an erorr in test.sh.
This generates spurious warnings in Travis:

test.sh: line 94: [: x: integer expression expected

And also prevents certain conditions from failing when they should.
2015-10-16 14:06:31 -07:00
Richard Barnes 3a70363366 Selectively hard fail 2015-10-12 20:36:57 -07:00
Richard Barnes 4e98b21fe2 Undo change to cause test failure 2015-10-10 13:08:50 -04:00
Richard Barnes fdae77844c Enable hard-fail and print prettier 2015-10-10 13:07:12 -04:00
Richard Barnes 0d17d030bc Revert down-scoping of test.sh 2015-10-07 10:43:17 -04:00
Richard Barnes 2de8747752 Set threshold back to 0.81 to suppress package name errors 2015-10-07 09:54:30 -04:00
Richard Barnes 5c3d851e99 Remove stray echo line 2015-10-07 09:46:09 -04:00
Richard Barnes 964794d918 Reove wrapper; move failure logic to run_and_comment 2015-10-07 09:42:45 -04:00
Richard Barnes 90484ac460 Add a wrapper that turns non-empty output into non-zero status 2015-10-06 23:12:23 -04:00
bifurcation 90050e91f5 Merge branch 'master' into golint 2015-10-05 19:23:24 -04:00
Jacob Hoffman-Andrews 6e355f8a57 test.sh: upgrade setuptools and pip to latest
Fixes https://github.com/letsencrypt/boulder/issues/921,
an interoperability issue in letsencrypt client tests.
2015-10-05 13:09:43 -07:00
Richard Barnes fd42948605 Upgrade test.sh to catch golint errors 2015-10-05 00:12:24 -04:00
Richard Barnes df87fcd739 Suppress remaining golint output 2015-10-04 21:22:49 -04:00
Jacob Hoffman-Andrews b3aca1ff2b Speed up tests.
Make `make` aware of output files so it doesn't always have to rebuild. Also
make it use `go install`, which is faster than building files individually.

Now that make is faster, use it in startservers.py to consolidate building
logic. This also has the handy side-effect that ./start.py exposes useful build
information through /build, whereas before only the .rpm packaged version did.

Additionally, this allows us to remove `make` from the Travis matrix, since we
are running `make` as part of the integration test. This means each PR only
triggers two Travis builds instead of one, which means we will get results from
Travis faster.

Also, change the Travis matrix logic to be a list of actions to run, rather than
a list of actions to skip. That fixes
https://github.com/letsencrypt/boulder/issues/817.

Enumerate specific sections of test.sh to run, rather than sections to skip.

Note: ./start.py now installs into ./bin/ instead of $GOPATH/bin.

Only set up GitHub secret file (for PR status reporting) when available, and
decrypt it into /tmp rather than $HOME, to avoid accidentally caching it once
Travis' caching features are available.

Clone letsencrypt repo into $HOME instead of $TMP, to make it possible to cache
eventually.

Remove unused `mysql` dependency in Travis.

Override default Travis install command to prevent it from adding
Godeps/_workspace to GOPATH. When that happens, it hides failures that should
arise from importing non-vendorized paths.
2015-10-01 16:28:17 -07:00
Jacob Hoffman-Andrews bc0d98a820 Fix amqp-integration-test.py when run alone.
Previously, test.sh was responsible for running venv/bin/activate, meaning that
`python test/amqp-integration-test.py` would fail to run the letsencrypt client.
Now, so long as LETSENCRYPT_PATH is already set to a valid dir (e.g. in your
.bashrc), `python test/amqp-integration-test.py` should work.
2015-09-23 17:06:14 -07:00
Jacob Hoffman-Andrews 69ddcb784c Add a test that there are no outdated migrations.
If a branch merges with a migration that is timestamped earlier than other
migrations already in master, that migration may get skipped.
2015-09-18 14:53:40 -07:00
Jeff Hodges e22d0eef9a speed up TravisCI by pre-installing test deps
This brings the TravisCI build time down to 4 minutes.

It does so by preventing the TravisCI job from having to build the
shared dependencies of the tests multiple times for each `go test` call.
2015-09-01 17:43:20 -07:00
Jacob Hoffman-Andrews 3afc1bb71a Merge pull request #624 from letsencrypt/mysql_unit
use MariaDB in the unit tests
2015-08-15 01:01:39 -07:00
Jeff Hodges 5e97aa23c6 use MariaDB in the unit tests
And delete the uses of sqlite3
2015-08-14 17:13:15 -07:00
Jeff Hodges 71c2e55f77 add all of cmd/ to test.sh and Makefile
Plus, add to test.sh all future possible packages by using `go list` and
all future possible cmd's to the Makefile with `find`.

Also, fix a bug in external-cert-importer from a bad merge somewhere.
2015-08-14 12:21:44 -07:00
Jeff Hodges 25ba6e0400 use the default, not racy covermode in TravisCI
The count covermode is racy and was causing spurious-to-us looking (but not
really) race detections in the tests. See
https://github.com/golang/go/issues/12118
2015-08-13 12:34:30 -07:00
Jacob Hoffman-Andrews 64987a3639 Merge pull request #599 from letsencrypt/mysql
use MariaDB in integration tests and start.py
2015-08-11 20:31:46 -07:00
Jacob Hoffman-Andrews cb2156817d Update test.sh comment re: Python client failure. 2015-08-10 10:31:21 -07:00
Jeff Hodges b08e6e0bad use MariaDB in integration tests and start.py
This changes moves from using SQLite in the integration tests and in the
test/boulder-config.json.

It does not port the unit tests over, unfortunately. That's a much more
invasive change.

This also updates the Dockerfile to include the MariaDB and RabbitMQ
requirements of start.py as well as adjusts the CMD to expose the
boulder server to the host machine. The Dockerfile also needed to have
its Go version bumped and the test.sh had to grow some explict
"function"s.

Updates #132
2015-08-07 23:22:52 -07:00
Jeff Hodges 9286988495 re-enable the letsencrypt client integration tests
Dependent on letsencrypt/letsencrypt#641 merging to master.
2015-07-31 15:15:49 -07:00
Jeff Hodges e0939573df clean up and harden build_letsencrypt
The run function and && combine poorly and cause exported variables to
somehow fail to cross over. run also does status code checking so we can
just use run twice and delete that extra unneeded exit command.

Along the way, move the warning message to where it belongs (creating a
temp directory instead of the user providing a stable path), and use the
new url for letsencrypt/letsencrypt.
2015-07-29 23:59:52 -07:00
Roland Shoemaker abd06564ec Merge branch 'master' into mailer 2015-07-27 12:46:19 -07:00
Roland Shoemaker bd9286dd5b Merge branch 'master' into mailer 2015-07-24 16:36:50 -07:00
Roland Shoemaker 19067da6a9 More tests 2015-07-24 16:36:03 -07:00
Jeff Hodges cfcd6dfc88 remove pkcs11 tag for build and test scripts
With #525 in place, we no longer need to worry about setting the pkcs11
tag everywhere.
2015-07-24 16:33:05 -07:00