-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #458 from cncf/split_specs
Split specs for faster builds
- Loading branch information
Showing
6 changed files
with
100 additions
and
37 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
spec/cnf_conformance_all/cnf_conformance_container_chaos_spec.cr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require "../spec_helper" | ||
require "../../src/tasks/utils/utils.cr" | ||
require "colorize" | ||
|
||
describe "CNF Conformance all Container Chaos" do | ||
before_all do | ||
`./cnf-conformance setup` | ||
$?.success?.should be_true | ||
end | ||
|
||
after_all do | ||
`./cnf-conformance samples_cleanup` | ||
$?.success?.should be_true | ||
end | ||
|
||
it "'all' should run the whole test suite", tags: "happy-path" do | ||
`./cnf-conformance samples_cleanup` | ||
response_s = `./cnf-conformance all ~platform ~compatibilty ~statelessness ~security ~scalability ~configuration_lifecycle ~observability ~installability ~hardware_affinity ~microservice ~chaos_network_loss cnf-config=./sample-cnfs/sample-coredns-cnf/cnf-conformance.yml verbose` | ||
LOGGING.info response_s | ||
(/Final workload score:/ =~ response_s).should_not be_nil | ||
(/Final score:/ =~ response_s).should_not be_nil | ||
(all_result_test_names(CNFManager.final_cnf_results_yml)).should eq([ "chaos_cpu_hog", "chaos_container_kill"]) | ||
$?.success?.should be_true | ||
end | ||
end |
25 changes: 25 additions & 0 deletions
25
spec/cnf_conformance_all/cnf_conformance_network_chaos_spec.cr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require "../spec_helper" | ||
require "../../src/tasks/utils/utils.cr" | ||
require "colorize" | ||
|
||
describe "CNF Conformance all Network Chaos" do | ||
before_all do | ||
`./cnf-conformance setup` | ||
$?.success?.should be_true | ||
end | ||
|
||
after_all do | ||
`./cnf-conformance samples_cleanup` | ||
$?.success?.should be_true | ||
end | ||
|
||
it "'all' should run the whole test suite", tags: "happy-path" do | ||
`./cnf-conformance samples_cleanup` | ||
response_s = `./cnf-conformance all ~platform ~compatibilty ~statelessness ~security ~scalability ~configuration_lifecycle ~observability ~installability ~hardware_affinity ~microservice ~chaos_cpu_hog ~chaos_container_kill cnf-config=./sample-cnfs/sample-coredns-cnf/cnf-conformance.yml verbose` | ||
LOGGING.info response_s | ||
(/Final workload score:/ =~ response_s).should_not be_nil | ||
(/Final score:/ =~ response_s).should_not be_nil | ||
(all_result_test_names(CNFManager.final_cnf_results_yml)).should eq([ "chaos_network_loss"]) | ||
$?.success?.should be_true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
require "../spec_helper" | ||
require "colorize" | ||
require "../../src/tasks/utils/utils.cr" | ||
require "../../src/tasks/utils/system_information/helm.cr" | ||
require "file_utils" | ||
require "sam" | ||
|
||
describe "Resilience Network Chaos" do | ||
before_all do | ||
`./cnf-conformance configuration_file_setup` | ||
$?.success?.should be_true | ||
end | ||
|
||
it "'chaos_network_loss' A 'Good' CNF should not crash when network loss occurs", tags: ["chaos_network_loss"] do | ||
begin | ||
`./cnf-conformance cnf_setup cnf-config=sample-cnfs/sample-coredns-cnf/cnf-conformance.yml` | ||
$?.success?.should be_true | ||
response_s = `./cnf-conformance chaos_network_loss verbose` | ||
LOGGING.info response_s | ||
$?.success?.should be_true | ||
(/PASSED: Replicas available match desired count after network chaos test/ =~ response_s).should_not be_nil | ||
ensure | ||
`./cnf-conformance cnf_cleanup cnf-config=sample-cnfs/sample-coredns-cnf/cnf-conformance.yml` | ||
$?.success?.should be_true | ||
end | ||
end | ||
|
||
it "'chaos_network_loss' A 'Bad' CNF should crash when network loss occurs", tags: ["chaos_network_loss"] do | ||
begin | ||
`./cnf-conformance cnf_setup cnf-path=sample-cnfs/sample_network_loss deploy_with_chart=false` | ||
$?.success?.should be_true | ||
response_s = `./cnf-conformance chaos_network_loss verbose` | ||
LOGGING.info response_s | ||
$?.success?.should be_true | ||
(/FAILURE: Replicas did not return desired count after network chaos test/ =~ response_s).should_not be_nil | ||
ensure | ||
`./cnf-conformance cnf_cleanup cnf-path=sample-cnfs/sample_network_loss deploy_with_chart=false` | ||
$?.success?.should be_true | ||
end | ||
end | ||
end |