|
22 | 22 |
|
23 | 23 | /** |
24 | 24 | * Created by vinicius.moreira on 19/04/2017. |
| 25 | + * |
| 26 | + * @author vinicious moreira |
| 27 | + * @author pesse |
25 | 28 | */ |
26 | 29 | @Parameters(separators = "=", commandDescription = "run tests") |
27 | 30 | public class RunCommand { |
@@ -70,6 +73,12 @@ public class RunCommand { |
70 | 73 | "-name_subexpression=0] - path to project test files") |
71 | 74 | private List<String> testPathParams = new ArrayList<>(); |
72 | 75 |
|
| 76 | + @Parameter( |
| 77 | + names = {"-scc", "--skip-compatibility-check"}, |
| 78 | + description = "Skips the check for compatibility with database framework. CLI expects the framework to be " + |
| 79 | + "most actual. Use this if you use CLI with a development version of utPLSQL-framework") |
| 80 | + private boolean skipCompatibilityCheck = false; |
| 81 | + |
73 | 82 | public ConnectionInfo getConnectionInfo() { |
74 | 83 | return connectionInfoList.get(0); |
75 | 84 | } |
@@ -133,6 +142,7 @@ public int run() throws Exception { |
133 | 142 | .testMappingOptions(testMappingOptions[0]) |
134 | 143 | .colorConsole(this.colorConsole) |
135 | 144 | .failOnErrors(true) |
| 145 | + .skipCompatibilityCheck(skipCompatibilityCheck) |
136 | 146 | .run(conn); |
137 | 147 | } catch (SomeTestsFailedException e) { |
138 | 148 | returnCode[0] = this.failureExitCode; |
@@ -204,15 +214,19 @@ public List<ReporterOptions> getReporterOptionsList() { |
204 | 214 | } |
205 | 215 |
|
206 | 216 | private void checkFrameworkCompatibility(ConnectionInfo ci) throws SQLException { |
207 | | - try |
208 | | - { |
209 | | - DBHelper.failOnVersionCompatibilityCheckFailed(ci.getConnection()); |
210 | | - } |
211 | | - catch ( DatabaseNotCompatibleException e ) |
212 | | - { |
213 | | - System.out.println(e.getMessage()); |
214 | 217 |
|
215 | | - throw e; |
| 218 | + if ( !skipCompatibilityCheck ) { |
| 219 | + try { |
| 220 | + DBHelper.failOnVersionCompatibilityCheckFailed(ci.getConnection()); |
| 221 | + } catch (DatabaseNotCompatibleException e) { |
| 222 | + System.out.println(e.getMessage()); |
| 223 | + |
| 224 | + throw e; |
| 225 | + } |
| 226 | + } |
| 227 | + else { |
| 228 | + System.out.println("Skipping Compatibility check with framework version, expecting the latest version " + |
| 229 | + "to be installed in database"); |
216 | 230 | } |
217 | 231 | } |
218 | 232 |
|
|
0 commit comments