Commit Graph

36 Commits

Author SHA1 Message Date
Seth Hoenig
b242957990 ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
Florian Apolloner
b52f42db9a Added a -hcl2-strict flag to allow for lenient hcl variable parsing. (#11284)
Co-authored-by: James Rasell <jrasell@hashicorp.com>
2021-11-04 16:33:09 +01:00
Mahmood Ali
ff1b2f7623 tests: ensure that tests restore env-var values (#11309)
Fix a test corruption issue, where a test accidentally unsets
the `NOMAD_LICENSE` environment variable, that's relied on by some
tests.

As a habit, tests should always restore the environment variable value
on test completion. Golang 1.17 introduced
[`t.Setenv`](https://pkg.go.dev/testing#T.Setenv) to address this issue.
However, as 1.0.x and 1.1.x branches target golang 1.15 and 1.16, I
opted to use a helper function to ease backports.
2021-10-13 17:26:56 -04:00
Mahmood Ali
4b25371842 tests: update test with a real invalid hcl2 2021-02-01 11:12:22 -05:00
Mahmood Ali
ae7e29ff49 actually pass env-vars to hcl2 parsing 2020-12-11 13:32:54 -05:00
Mahmood Ali
6bfbadc199 actually honor var files (#9592)
Apparently, we missed passing VarFile argument, so var files were
ignored.

Fixes #9588
2020-12-09 14:12:48 -05:00
Mahmood Ali
73df83fffd Custom message when job file is HCL2 incompatible
Use a custom message when the job file is a valid HCL1 but no longer
valid under HCL 2 syntax.
2020-11-10 14:56:20 -05:00
Mahmood Ali
5a784f43a3 Start using the new jobspec2 API 2020-11-09 15:01:31 -05:00
Mahmood Ali
93bbe181e0 address review feedback 2020-10-22 11:49:37 -04:00
Mahmood Ali
2a9232902c hclv1: tweak HCLv1 tests
This ensures that gatway ReadOnly key is tested.  Also, update the hclv1
test-fixtures to be hclv1 compliant.
2020-10-21 14:05:46 -04:00
James Rasell
f5567b3261 cli: move tests to use NewMockUi func. 2020-10-05 16:07:41 +02:00
Mahmood Ali
af2e2bc7ed cli: sequence cli.Ui operations
Fixes a bug where if a command flag parsing errors, the resulting error
and help usage messages get interleaved in unexpected and non-user
friendly way.

The reason is that we have flag parsing library effectively writes to
ui.Error in a goroutine.  This is problematic: first, we lose the sequencing between help
usage and error message; second, cli.Ui methods are not concurrent safe.

Here, we introduce a custom error writer that buffers result and calls
ui.Error() in the write method and in the same goroutine.

For context, we need to wrap ui.Error because it's line-oriented, while
flags library expects a io.Writer which is bytes oriented.
2019-12-16 10:08:17 -05:00
Lars Lehtonen
2784f166e5 command: fix TestHelpers_LineLimitReader_TimeLimit() goroutine (#6678) 2019-11-12 08:35:11 -05:00
Alex Dadgar
8f47469f5c fix flaky pretty time test 2018-04-03 18:15:12 -07:00
Preetha Appan
69c4a58c34 Show reschedule eligibility time in alloc-status when followup evalid is available 2018-03-14 16:10:32 -05:00
Alex Dadgar
ddee932500 Fix upgrade path of modify time 2017-12-11 15:58:24 -08:00
Preetha Appan
c0e79a164d Fix flaky test TestPrettyTimeDiff 2017-11-16 09:48:14 -06:00
Preetha Appan
9e5f12f8b4 Declare time.Now once to prevent flakiness 2017-11-14 20:32:02 -06:00
Preetha Appan
bc833c9c8c Handle edge case when allocation create/modify time difference is less than a second ago. 2017-11-14 16:40:34 -06:00
Preetha Appan
33475d169a New pretty printer that imitates the short form from time.Duration.String() with approximated values for days and beyond. Used in cli output for allocation create/modify times 2017-11-01 15:16:38 -05:00
Alex Dadgar
a77c6a4f71 Parallel 2017-07-20 21:24:21 -07:00
Alex Dadgar
da25a3d5ce Switch to in-process agent 2017-07-20 21:07:32 -07:00
Alex Dadgar
eaa57878d9 Vendor + test fixes 2017-02-22 15:55:33 -08:00
Alex Dadgar
6debb3e03b Refactor test and fix them 2017-02-16 14:00:41 -08:00
Alex Dadgar
b6e0d12de7 Flatmap 2017-02-16 13:52:39 -08:00
Alex Dadgar
7eac718eea Use RC to see if cause of failure 2017-02-16 13:52:39 -08:00
Diptanu Choudhury
5502a669e8 Added tests 2017-02-16 13:52:39 -08:00
Alex Dadgar
1399cd6293 Fix interval breaking two tests 2017-02-14 17:06:30 -08:00
Kenjiro Nakayama
5edc9d1072 Add StructJob test with jobfile from HTTP Server 2016-08-17 11:06:08 +09:00
Kenjiro Nakayama
bbc6a48596 Rename Helper to JobGetter 2016-08-17 11:06:08 +09:00
Kenjiro Nakayama
d00090ab8b Use go-getter to get jobfile by URL 2016-08-17 11:06:08 +09:00
Alex Dadgar
ac1cfd1821 unblock the readers to add liveness when using -n 2016-07-25 11:16:01 -07:00
Alex Dadgar
991220b5c7 implement -n for tail 2016-07-13 13:26:09 -06:00
Alex Dadgar
e6e3225c5c Add -self flag to node-drain 2016-04-11 15:20:49 -07:00
Ryan Uber
8a57dbacac command: placeholder for <none> in kv output 2015-09-27 14:04:53 -07:00
Ryan Uber
210ee0bbb7 command: helpers for columns 2015-09-15 16:44:38 -07:00