File tree Expand file tree Collapse file tree
devops-framework-core/src/test/java/org/devops/framework/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,10 +13,28 @@ public class ComponentManifestTests extends GroovyTestCase {
1313 def map = Utilities . mapProperties(propFile)
1414
1515 /**
16- * Utility function to get tmpDir used for testing
16+ * Utility function for getting tmpDir
1717 */
1818 File getTmpDir () {
19- return new File ((map. get(" tmpDir" ) != null ) ? map. get(" tmpDir" ) : System . getProperty(" java.io.tmpdir" ))
19+ if (runUnitTestsOnly()) {
20+ return new File (System . getProperty(" java.io.tmpdir" ))
21+ } else {
22+ return new File ((map. get(" tmpDir" ) != null ) ? map. get(" tmpDir" ) : System . getProperty(" java.io.tmpdir" ))
23+ }
24+ }
25+
26+ /**
27+ * Utility function for seeing if need to just run unit-tests
28+ */
29+ boolean runUnitTestsOnly () {
30+ if (System . getenv(" DEVOPS_FRAMEWORK_UNITTESTS" )!= null ) {
31+ return true ;
32+ }
33+ String unitTests = map. get(" unit_tests_only" )
34+ if (unitTests != null && ! unitTests. isEmpty()) {
35+ return (unitTests. contains(" true" ))
36+ }
37+ return false
2038 }
2139
2240 /**
Original file line number Diff line number Diff line change @@ -12,9 +12,29 @@ public class FileRepositoryTests extends GroovyTestCase {
1212 File propFile = new File (" ." + " /src/test/resources/unitTest.properties" )
1313 def map = Utilities . mapProperties(propFile)
1414
15- // Utility function to get temporary directory...
15+ /**
16+ * Utility function for getting tmpDir
17+ */
1618 File getTmpDir () {
17- return new File ((map. get(" tmpDir" ) != null ) ? map. get(" tmpDir" ) : System . getProperty(" java.io.tmpdir" ))
19+ if (runUnitTestsOnly()) {
20+ return new File (System . getProperty(" java.io.tmpdir" ))
21+ } else {
22+ return new File ((map. get(" tmpDir" ) != null ) ? map. get(" tmpDir" ) : System . getProperty(" java.io.tmpdir" ))
23+ }
24+ }
25+
26+ /**
27+ * Utility function for seeing if need to just run unit-tests
28+ */
29+ boolean runUnitTestsOnly () {
30+ if (System . getenv(" DEVOPS_FRAMEWORK_UNITTESTS" )!= null ) {
31+ return true ;
32+ }
33+ String unitTests = map. get(" unit_tests_only" )
34+ if (unitTests != null && ! unitTests. isEmpty()) {
35+ return (unitTests. contains(" true" ))
36+ }
37+ return false
1838 }
1939
2040 /**
Original file line number Diff line number Diff line change @@ -12,6 +12,31 @@ public class NotificationsTests extends GroovyTestCase {
1212 File propFile = new File (" ." + " /src/test/resources/unitTest.properties" )
1313 def map = Utilities . mapProperties(propFile)
1414
15+ /**
16+ * Utility function for getting tmpDir
17+ */
18+ File getTmpDir () {
19+ if (runUnitTestsOnly()) {
20+ return new File (System . getProperty(" java.io.tmpdir" ))
21+ } else {
22+ return new File ((map. get(" tmpDir" ) != null ) ? map. get(" tmpDir" ) : System . getProperty(" java.io.tmpdir" ))
23+ }
24+ }
25+
26+ /**
27+ * Utility function for seeing if need to just run unit-tests
28+ */
29+ boolean runUnitTestsOnly () {
30+ if (System . getenv(" DEVOPS_FRAMEWORK_UNITTESTS" )!= null ) {
31+ return true ;
32+ }
33+ String unitTests = map. get(" unit_tests_only" )
34+ if (unitTests != null && ! unitTests. isEmpty()) {
35+ return (unitTests. contains(" true" ))
36+ }
37+ return false
38+ }
39+
1540 /**
1641 * Unit test for using Slack messaging
1742 */
Original file line number Diff line number Diff line change @@ -99,8 +99,6 @@ public class UtilityTests extends GroovyTestCase {
9999 String returnOutput = returnStr. toString()
100100 returnOutput = returnOutput. trim()
101101 assertTrue (retStat> 0 )
102- assertTrue (returnOutput. contains(" lsdx: command not found" ) ||
103- returnOutput. contains(" \" lsdx\" : error=2, No such file or directory" ))
104102 }
105103
106104 /**
You can’t perform that action at this time.
0 commit comments