Skip to content

Commit

Permalink
fix: Expand max env var limit to 100 (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkyi authored and minzcmu committed Aug 23, 2018
1 parent ee84e48 commit 9eaf335
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/phase/functional.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const WorkflowParser = require('screwdriver-workflow-parser');

// Actual environment size is limited by space, not quantity.
// We do this to force sd.yaml to be simpler.
const MAX_ENVIRONMENT_VARS = 35;
const MAX_ENVIRONMENT_VARS = 100;
// If they are trying to execute >25 permutations,
// maybe there is a better way to accomplish their goal.
const MAX_PERMUTATIONS = 25;
Expand Down
65 changes: 65 additions & 0 deletions test/data/too-many-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,68 @@ jobs:
VAR34: 34
VAR35: 35
VAR36: 36
VAR37: 37
VAR38: 38
VAR39: 39
VAR40: 40
VAR41: 41
VAR42: 42
VAR43: 43
VAR44: 44
VAR45: 45
VAR46: 46
VAR47: 47
VAR48: 48
VAR49: 49
VAR50: 50
VAR51: 51
VAR52: 52
VAR53: 53
VAR54: 54
VAR55: 55
VAR56: 56
VAR57: 57
VAR58: 58
VAR59: 59
VAR60: 60
VAR61: 61
VAR62: 62
VAR63: 63
VAR64: 64
VAR65: 65
VAR66: 66
VAR67: 67
VAR68: 68
VAR69: 69
VAR70: 70
VAR71: 71
VAR72: 72
VAR73: 73
VAR74: 74
VAR75: 75
VAR76: 76
VAR77: 77
VAR78: 78
VAR79: 79
VAR80: 80
VAR81: 81
VAR82: 82
VAR83: 83
VAR84: 84
VAR85: 85
VAR86: 86
VAR87: 87
VAR88: 88
VAR89: 89
VAR90: 90
VAR91: 91
VAR92: 92
VAR93: 93
VAR94: 94
VAR95: 95
VAR96: 96
VAR97: 97
VAR98: 98
VAR99: 99
VAR100: 100
VAR101: 101
65 changes: 65 additions & 0 deletions test/data/too-many-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,68 @@ jobs:
VAR32: 32
VAR33: 33
VAR34: 34
VAR35: 35
VAR36: 36
VAR37: 37
VAR38: 38
VAR39: 39
VAR40: 40
VAR41: 41
VAR42: 42
VAR43: 43
VAR44: 44
VAR45: 45
VAR46: 46
VAR47: 47
VAR48: 48
VAR49: 49
VAR50: 50
VAR51: 51
VAR52: 52
VAR53: 53
VAR54: 54
VAR55: 55
VAR56: 56
VAR57: 57
VAR58: 58
VAR59: 59
VAR60: 60
VAR61: 61
VAR62: 62
VAR63: 63
VAR64: 64
VAR65: 65
VAR66: 66
VAR67: 67
VAR68: 68
VAR69: 69
VAR70: 70
VAR71: 71
VAR72: 72
VAR73: 73
VAR74: 74
VAR75: 75
VAR76: 76
VAR77: 77
VAR78: 78
VAR79: 79
VAR80: 80
VAR81: 81
VAR82: 82
VAR83: 83
VAR84: 84
VAR85: 85
VAR86: 86
VAR87: 87
VAR88: 88
VAR89: 89
VAR90: 90
VAR91: 91
VAR92: 92
VAR93: 93
VAR94: 94
VAR95: 95
VAR96: 96
VAR97: 97
VAR98: 98
VAR99: 99
4 changes: 2 additions & 2 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,15 +333,15 @@ describe('config parser', () => {
parser(loadData('too-many-environment.yaml'))
.then((data) => {
assert.match(data.jobs.main[0].commands[0].command,
/"environment" can only have 35 environment/);
/"environment" can only have 100 environment/);
})
);

it('do not count SD_TEMPLATE variables for max environment variables', () =>
parser(loadData('environment-with-SD-variable.yaml'))
.then((data) => {
assert.notMatch(data.jobs.main[0].commands[0].command,
/"environment" can only have 35 environment/);
/"environment" can only have 100 environment/);
})
);

Expand Down

0 comments on commit 9eaf335

Please sign in to comment.