Skip to content

Commit f3d798a

Browse files
committed
Adding automatic failure of Admin API tests if sandbox deployment fails.
- This will prevent Admin API tests to continue under these condition given they wil fail anyway.
1 parent 599a0db commit f3d798a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

unittest/shell_js_dba_t.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@ namespace shcore {
3434
class Shell_js_dba_tests : public Shell_js_script_tester {
3535
protected:
3636
bool _have_ssl;
37+
static bool have_sandboxes;
3738
// You can define per-test set-up and tear-down logic as usual.
3839
virtual void SetUp() {
40+
if (!have_sandboxes) {
41+
FAIL();
42+
}
43+
3944
Shell_js_script_tester::SetUp();
4045

4146
// All of the test cases share the same config folder
@@ -191,6 +196,8 @@ class Shell_js_dba_tests : public Shell_js_script_tester {
191196

192197
};
193198

199+
bool Shell_js_dba_tests::have_sandboxes = true;
200+
194201
TEST_F(Shell_js_dba_tests, no_active_session_error) {
195202
_options->wizards = false;
196203
reset_shell();
@@ -260,6 +267,9 @@ TEST_F(Shell_js_dba_tests, no_interactive_deploy_instances) {
260267
execute("dba.verbose = true;");
261268

262269
validate_interactive("dba_reset_or_deploy.js");
270+
271+
if (::testing::Test::HasFailure())
272+
have_sandboxes = false;
263273
}
264274

265275
TEST_F(Shell_js_dba_tests, interactive_deploy_instance) {

unittest/shell_py_dba_t.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@ namespace shcore {
3030
class Shell_py_dba_tests : public Shell_py_script_tester {
3131
protected:
3232
bool _have_ssl;
33+
static bool have_sandboxes;
3334
// You can define per-test set-up and tear-down logic as usual.
3435
virtual void SetUp() {
36+
if (!have_sandboxes) {
37+
FAIL();
38+
}
39+
3540
Shell_py_script_tester::SetUp();
3641

3742
// All of the test cases share the same config folder
@@ -183,6 +188,8 @@ class Shell_py_dba_tests : public Shell_py_script_tester {
183188

184189
};
185190

191+
bool Shell_py_dba_tests::have_sandboxes = true;
192+
186193
TEST_F(Shell_py_dba_tests, no_active_session_error) {
187194
_options->wizards = false;
188195
reset_shell();
@@ -247,6 +254,9 @@ TEST_F(Shell_py_dba_tests, no_interactive_deploy_instances) {
247254
execute("dba.verbose = True");
248255

249256
validate_interactive("dba_reset_or_deploy.py");
257+
258+
if (::testing::Test::HasFailure())
259+
have_sandboxes = false;
250260
}
251261

252262
TEST_F(Shell_py_dba_tests, no_interactive_classic_global_dba) {

0 commit comments

Comments
 (0)