jrasell / sherpa

Sherpa is a highly available, fast, and flexible horizontal job scaling for HashiCorp Nomad. It is capable of running in a number of different modes to suit different requirements, and can scale based on Nomad resource metrics or external sources.
Mozilla Public License 2.0
163 stars 8 forks source link

Add acceptance test for meta policy engine and scaling actions. #60

Closed jrasell closed 4 years ago

jrasell commented 4 years ago

The acceptance testing has been expanded to cover scaling actions as well as the Nomad meta policy backend. The Nomad meta engine requires Sherpa to run in a different mode than the rest of the tests, therefore the make targets have been split to make this clear until the whole process is automated.

The scale tests are particulary basic, but are a start for further work in the future.

These tests have already uncovered #59.

A condensed test report for the two targets:

=== RUN   TestPolicy_list
--- PASS: TestPolicy_list (0.14s)
=== RUN   TestPolicy_readJob
--- PASS: TestPolicy_readJob (0.14s)
=== RUN   TestPolicy_readJobGroup
--- PASS: TestPolicy_readJobGroup (0.14s)
=== RUN   TestPolicy_write
--- PASS: TestPolicy_write (0.14s)
=== RUN   TestPolicy_deleteJobPolicy
--- PASS: TestPolicy_deleteJobPolicy (0.14s)
=== RUN   TestPolicy_deleteJobGroupPolicy
--- PASS: TestPolicy_deleteJobGroupPolicy (0.15s)
=== RUN   TestScaleIn_singleTaskGroupCountSet
--- PASS: TestScaleIn_singleTaskGroupCountSet (0.66s)
=== RUN   TestScaleIn_singleTaskGroupCountSetTooLow
--- PASS: TestScaleIn_singleTaskGroupCountSetTooLow (0.64s)
=== RUN   TestScaleOut_singleTaskGroupCountSet
--- PASS: TestScaleOut_singleTaskGroupCountSet (0.65s)
=== RUN   TestScaleOut_singleTaskGroupCountSetTooHigh
--- PASS: TestScaleOut_singleTaskGroupCountSetTooHigh (0.66s)
=== RUN   TestMetaPolicy_singleTaskGroupFullMetaRemoveAllMeta
--- PASS: TestMetaPolicy_singleTaskGroupFullMetaRemoveAllMeta (1.16s)
=== RUN   TestMetaPolicy_singleTaskGroupFullMetaStopJob
--- PASS: TestMetaPolicy_singleTaskGroupFullMetaStopJob (1.14s)
=== RUN   TestMetaPolicy_multiTaskGroupFullMetaRemoveAllMeta
--- PASS: TestMetaPolicy_multiTaskGroupFullMetaRemoveAllMeta (1.15s)
=== RUN   TestMetaPolicy_multiTaskGroupFullMetaStopJob
--- PASS: TestMetaPolicy_multiTaskGroupFullMetaStopJob (1.14s)
=== RUN   TestMetaPolicy_multiTaskGroupPartialMetaRemoveAllMeta
--- PASS: TestMetaPolicy_multiTaskGroupPartialMetaRemoveAllMeta (1.16s)
=== RUN   TestMetaPolicy_multiTaskGroupPartialMetaStopJob
--- PASS: TestMetaPolicy_multiTaskGroupPartialMetaStopJob (1.16s)
=== RUN   TestMetaPolicy_multiTaskGroupPartialMetaAddAllMeta
--- PASS: TestMetaPolicy_multiTaskGroupPartialMetaAddAllMeta (1.14s)