Skip to content

Commit

Permalink
Merge pull request #34 from emjburns/tests-ami-parsing
Browse files Browse the repository at this point in the history
chore(tests): add more cases for ami name parsing
  • Loading branch information
emjburns authored Sep 14, 2020
2 parents d24ab6f + 6e27260 commit c232de7
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions src/test/groovy/com/netflix/frigga/ami/AppVersionTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -110,27 +110,29 @@ class AppVersionTest extends Specification {
appVersion.buildJobName == buildJob

where:
appversionString | packageName | version | commit | buildNumber | buildJob
'appName-0.1-9b3bc237.h150' | 'appName' | '0.1' | '9b3bc237' | '150' | null
'appName-0.1-9b3bc237.h150' | 'appName' | '0.1' | '9b3bc237' | '150' | null
'appName-0.1b34-9b3bc237.h150' | 'appName' | '0.1b34' | '9b3bc237' | '150' | null
'appName-0.1-1630379' | 'appName' | '0.1' | '1630379' | null | null
'appName-0.1-1' | 'appName' | '0.1' | '1' | null | null
'appName-0.1-abcd6789' | 'appName' | '0.1' | 'abcd6789' | null | null
'appName-0.1~rc.1-1630379' | 'appName' | '0.1~rc.1' | '1630379' | null | null
'appName-0.1~dev.1-9b3bc237.h150' | 'appName' | '0.1~dev.1' | '9b3bc237' | '150' | null
'appName-0.1~dev.3.uncommitted-h0.54f3416' | 'appName' | '0.1~dev.3.uncommitted' | '54f3416' | '0' | null
'testApp-1.3.0-h196/mybuild/196' | 'testApp' | '1.3.0' | null | '196' | 'mybuild'
'testApp-1.3.0-h196.9b3bc237/mybuild/196' | 'testApp' | '1.3.0' | '9b3bc237' | '196' | 'mybuild'
'testApp-1.3.0~dev.5.uncommitted-h196.9b3bc237/mybuild/196' | 'testApp' | '1.3.0~dev.5.uncommitted' | '9b3bc237' | '196' | 'mybuild'
'sub-1.0.0-586499' | 'sub' | '1.0.0' | '586499' | null | null
'sub-1.0.0-586499.h150' | 'sub' | '1.0.0' | '586499' | '150' | null
'sub-1.0.0-586499.h150/WE-WAPP-sub/150' | 'sub' | '1.0.0' | '586499' | '150' | 'WE-WAPP-sub'
'sub-1.0.0b4-586499.h150/WE-WAPP-sub/150' | 'sub' | '1.0.0b4' | '586499' | '150' | 'WE-WAPP-sub'
'sub-1.0.0b3-586499.h150' | 'sub' | '1.0.0b3' | '586499' | '150' | null
'sub-1.0.0B3-586499.h150' | 'sub' | '1.0.0B3' | '586499' | '150' | null
'sub-1.2~rc.2-h78.67ee1291/WE-WAPP-sub.nxt/78' | 'sub' | '1.2~rc.2' | '67ee1291' | '78' | 'WE-WAPP-sub.nxt'
'sub-1.2-h78.67ee1291/WE-WAPP-sub.nxt/78' | 'sub' | '1.2' | '67ee1291' | '78' | 'WE-WAPP-sub.nxt'
appversionString | packageName | version | commit | buildNumber | buildJob
'appName-0.1-9b3bc237.h150' | 'appName' | '0.1' | '9b3bc237' | '150' | null
'appName-0.1-9b3bc237.h150' | 'appName' | '0.1' | '9b3bc237' | '150' | null
'appName-0.1b34-9b3bc237.h150' | 'appName' | '0.1b34' | '9b3bc237' | '150' | null
'appName-0.1-1630379' | 'appName' | '0.1' | '1630379' | null | null
'appName-0.1-1' | 'appName' | '0.1' | '1' | null | null
'appName-0.1-abcd6789' | 'appName' | '0.1' | 'abcd6789' | null | null
'appName-0.1~rc.1-1630379' | 'appName' | '0.1~rc.1' | '1630379' | null | null
'appName-0.1~dev.1-9b3bc237.h150' | 'appName' | '0.1~dev.1' | '9b3bc237' | '150' | null
'appName-0.1~dev.3.uncommitted-h0.54f3416' | 'appName' | '0.1~dev.3.uncommitted' | '54f3416' | '0' | null
'testApp-1.3.0-h196/mybuild/196' | 'testApp' | '1.3.0' | null | '196' | 'mybuild'
'testApp-1.3.0-h196.9b3bc237/mybuild/196' | 'testApp' | '1.3.0' | '9b3bc237' | '196' | 'mybuild'
'testApp-1.3.0~dev.5.uncommitted-h196.9b3bc237/mybuild/196' | 'testApp' | '1.3.0~dev.5.uncommitted' | '9b3bc237' | '196' | 'mybuild'
'sub-1.0.0-586499' | 'sub' | '1.0.0' | '586499' | null | null
'sub-1.0.0-586499.h150' | 'sub' | '1.0.0' | '586499' | '150' | null
'sub-1.0.0-586499.h150/WE-WAPP-sub/150' | 'sub' | '1.0.0' | '586499' | '150' | 'WE-WAPP-sub'
'sub-1.0.0b4-586499.h150/WE-WAPP-sub/150' | 'sub' | '1.0.0b4' | '586499' | '150' | 'WE-WAPP-sub'
'sub-1.0.0b3-586499.h150' | 'sub' | '1.0.0b3' | '586499' | '150' | null
'sub-1.0.0B3-586499.h150' | 'sub' | '1.0.0B3' | '586499' | '150' | null
'sub-1.2~rc.2-h78.67ee1291/WE-WAPP-sub.nxt/78' | 'sub' | '1.2~rc.2' | '67ee1291' | '78' | 'WE-WAPP-sub.nxt'
'sub-1.2-h78.67ee1291/WE-WAPP-sub.nxt/78' | 'sub' | '1.2' | '67ee1291' | '78' | 'WE-WAPP-sub.nxt'
'my-app-0.0.1~snapshot.202009092025-h108.2258259' | 'my-app' | '0.0.1~snapshot.202009092025'| '2258259' | '108' | null
'my-app-0.0.1~snapshot.202009092025-h108.2258259/MY-J-JOB/108'| 'my-app' | '0.0.1~snapshot.202009092025'| '2258259' | '108' | 'MY-J-JOB'
}

boolean assertIsLessThan(AppVersion lesser, AppVersion greater) {
Expand Down

0 comments on commit c232de7

Please sign in to comment.