Skip to content

Commit 5eb8e35

Browse files
committed
Add runtime version metadata
1 parent cad3b15 commit 5eb8e35

File tree

3 files changed

+91
-2
lines changed

3 files changed

+91
-2
lines changed
File renamed without changes.

cjs/index.js

+76
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,81 @@ let runtimes = {
3232
],
3333
}
3434

35+
let runtimeVersions = {
36+
'nodejs14.x': {
37+
major: '14',
38+
minor: null,
39+
patch: null,
40+
wildcard: '14.*.*'
41+
},
42+
'nodejs12.x': {
43+
major: '12',
44+
minor: null,
45+
patch: null,
46+
wildcard: '12.*.*',
47+
},
48+
'python3.9': {
49+
major: '3',
50+
minor: '9',
51+
patch: null,
52+
wildcard: '3.9.*',
53+
},
54+
'python3.8': {
55+
major: '3',
56+
minor: '8',
57+
patch: null,
58+
wildcard: '3.8.*',
59+
},
60+
'python3.7': {
61+
major: '3',
62+
minor: '7',
63+
patch: null,
64+
wildcard: '3.7.*',
65+
},
66+
'python3.6': {
67+
major: '3',
68+
minor: '6',
69+
patch: null,
70+
wildcard: '3.6.*',
71+
},
72+
'ruby2.7': {
73+
major: '2',
74+
minor: '7',
75+
patch: null,
76+
wildcard: '2.7.*',
77+
},
78+
'java11': {
79+
major: '11',
80+
minor: null,
81+
patch: null,
82+
wildcard: '11.*.*',
83+
},
84+
'java8.al2': {
85+
major: '8',
86+
minor: null,
87+
patch: null,
88+
wildcard: '8.*.*',
89+
},
90+
'java8': {
91+
major: '8',
92+
minor: null,
93+
patch: null,
94+
wildcard: '8.*.*',
95+
},
96+
'go1.x': {
97+
major: '1',
98+
minor: null,
99+
patch: null,
100+
wildcard: '1.*.*',
101+
},
102+
'dotnetcore3.1': {
103+
major: '3',
104+
minor: '1',
105+
patch: null,
106+
wildcard: '3.1.*',
107+
},
108+
}
109+
35110
let runtimeList = Object.values(runtimes).reduce((a, b) => a.concat(b), [])
36111

37112
let runtimesByArchitecture = {
@@ -110,6 +185,7 @@ let retiredRuntimes = {
110185

111186
module.exports = {
112187
runtimes,
188+
runtimeVersions,
113189
runtimeList,
114190
runtimesByArchitecture,
115191
architecturesByRuntime,

test/unit/esm/index-test.js

+15-2
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,24 @@ test('Set up env', t => {
77
})
88

99
test('Exports', t => {
10-
t.plan(7)
10+
t.plan(8)
1111
let {
1212
runtimes,
13+
runtimeVersions,
1314
runtimeList,
1415
runtimesByArchitecture,
1516
architecturesByRuntime,
1617
aliases,
1718
retiredRuntimes,
1819
} = lambdaRuntimes
1920
t.ok(runtimes, 'Got runtimes')
21+
t.ok(runtimeVersions, 'Got runtimeVersions')
2022
t.ok(runtimeList, 'Got runtimeList')
2123
t.ok(runtimesByArchitecture, 'Got runtimesByArchitecture')
2224
t.ok(architecturesByRuntime, 'Got architecturesByRuntime')
2325
t.ok(aliases, 'Got aliases')
2426
t.ok(retiredRuntimes, 'Got retiredRuntimes')
25-
t.equal(Object.keys(lambdaRuntimes).length, 6, 'Got all properties')
27+
t.equal(Object.keys(lambdaRuntimes).length, 7, 'Got all properties')
2628
console.dir(lambdaRuntimes, { depth: null })
2729
})
2830

@@ -35,6 +37,17 @@ test('runtimes semantics', t => {
3537
t.pass('All runtimes values are arrays')
3638
})
3739

40+
test('runtimeVersions semantics', t => {
41+
t.plan(2)
42+
let { runtimeList, runtimeVersions } = lambdaRuntimes
43+
let list = runtimeList.filter(r => !r.startsWith('provided'))
44+
list.forEach(runtime => {
45+
if (!runtimeVersions[runtime]) t.fail(`${runtime} not found in runtimeVersions`)
46+
})
47+
t.pass('Found all runtimeVersions')
48+
t.equal(list.length, Object.keys(runtimeVersions).length, 'Correct number of runtimeVersions found')
49+
})
50+
3851
test('runtimeList semantics', t => {
3952
t.plan(1)
4053
let { runtimeList } = lambdaRuntimes

0 commit comments

Comments
 (0)