Skip to content

Commit

Permalink
improve test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
cfmitrah committed Apr 22, 2024
1 parent 2c0ae8e commit bd4645f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/tickets/LDEV4827.cfc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
component extends="org.lucee.cfml.test.LuceeTestCase" {

function beforeAll() {
variables.mssql= getCredentials();
variables.mssql = getCredentials();
}

function run( testResults , testBox ) {
describe( "Test suite for LDEV-4827", function() {
it( title='Checking Query with real result on mssql',body = function( currentSpec ) {
it( title='Checking Query with real result on mssql', skip=checkMySqlEnvVarsAvailable(), body=function( currentSpec ) {
adm = new Administrator('server', request.SERVERADMINPASSWORD?:server.SERVERADMINPASSWORD);
adm.updateDatasource(
name: 'datasource4827',
Expand Down Expand Up @@ -36,6 +36,10 @@ component extends="org.lucee.cfml.test.LuceeTestCase" {
});
}

private boolean function checkMySqlEnvVarsAvailable() {
return (StructCount(server.getDatasource("mssql")) eq 0);
}

private struct function getCredentials() {
// getting the credentials from the environment variables
var mssql = {};
Expand Down

0 comments on commit bd4645f

Please sign in to comment.