Skip to content

Commit f0360f9

Browse files
Fixed the kernel2 test
Signed-off-by: Abhijit Gadgil <agadgil@progress.com>
1 parent ee22494 commit f0360f9

1 file changed

Lines changed: 28 additions & 28 deletions

File tree

test/builder-api/src/packages.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,15 @@ describe('Working with packages', function () {
219219
});
220220
});
221221

222-
it('uploads a kernel2 package', function (done) {
222+
it('uploads a kernel2 package (error)', function (done) {
223223
request.post(`/depot/pkgs/neurosis/testapp/0.1.3/${release8}`)
224224
.set('Authorization', global.boboBearer)
225225
.set('Content-Length', file8.length)
226226
.query({ checksum: 'bdae4812e37aa8d6d29eb5beae930c69334006e44edcbbbf75ec817c5e48ca2c' })
227227
.send(file8)
228228
.expect(201)
229229
.end(function (err, res) {
230-
expect(res.text).to.equal(`/pkgs/neurosis/testapp/0.1.3/${release8}/download`);
230+
expect(res.text).to.include(`err=InvalidPackageTarget("x86_64-linux-kernel2")`);
231231
done(err);
232232
});
233233
});
@@ -910,7 +910,7 @@ describe('Working with packages', function () {
910910
});
911911
});
912912

913-
// TODO supposed to be empty, need to revisit
913+
// TODO supposed to be empty, need to revisit
914914
it('tests the builder events after demoting a package', function (done) {
915915
const url = appendDateRange('/depot/events');
916916
request.get(url)
@@ -1002,10 +1002,10 @@ describe('Working with packages', function () {
10021002
const demotePath = (channel) => `/depot/channels/${origin}/${channel}/pkgs/${name}/${version}/${release}/demote`;
10031003
const createChannelPath = (channel) => `/depot/channels/${origin}/${channel}`;
10041004
const deleteChannelPath = (channel) => `/depot/channels/${origin}/${channel}`;
1005-
1005+
10061006
const validLicenseKey = 'free-6cc49568-d1e8-4165-b1a9-6b232b914ca6-7839';
10071007
const expiredLicenseKey = 'tmns-3785e812-1704-4d08-836d-2f35bdfddce4-4914';
1008-
1008+
10091009
function addLicenseKey(key, done) {
10101010
request.put('/profile/license')
10111011
.set('Authorization', global.boboBearer)
@@ -1016,44 +1016,44 @@ describe('Working with packages', function () {
10161016
.expect(200)
10171017
.end(done);
10181018
}
1019-
1019+
10201020
function removeLicenseKey(done) {
10211021
request.delete('/profile/license')
10221022
.set('Authorization', global.boboBearer)
10231023
.expect(200)
10241024
.end(done);
10251025
}
1026-
1026+
10271027
function createChannel(channel, done) {
10281028
request.post(createChannelPath(channel))
10291029
.set('Authorization', global.boboBearer)
10301030
.expect(201)
10311031
.end(done);
10321032
}
1033-
1033+
10341034
function deleteChannel(channel, done) {
10351035
request.delete(deleteChannelPath(channel))
10361036
.set('Authorization', global.boboBearer)
10371037
.expect(200)
10381038
.end(done);
10391039
}
1040-
1040+
10411041
function promoteTo(channel, done) {
10421042
request.put(promotePath(channel))
10431043
.query({ target })
10441044
.set('Authorization', global.boboBearer)
10451045
.expect(200)
10461046
.end(done);
10471047
}
1048-
1048+
10491049
function demoteFrom(channel, done) {
10501050
request.put(demotePath(channel))
10511051
.query({ target })
10521052
.set('Authorization', global.boboBearer)
10531053
.expect(200)
10541054
.end(done);
10551055
}
1056-
1056+
10571057
before(function (done) {
10581058
request.post('/profile/access-tokens')
10591059
.set('Authorization', global.boboBearer)
@@ -1064,19 +1064,19 @@ describe('Working with packages', function () {
10641064
if (err) return done(err);
10651065
expect(res.body.token).to.not.be.empty;
10661066
global.boboId = res.body.id;
1067-
1067+
10681068
createChannel('LTS-2024', () => {
10691069
createChannel('base-2025', done);
10701070
});
10711071
});
10721072
});
1073-
1073+
10741074
after(function (done) {
10751075
deleteChannel('LTS-2024', () => {
10761076
deleteChannel('base-2025', done);
10771077
});
10781078
});
1079-
1079+
10801080
it('succeeds without license when package is only in LTS-2024', function (done) {
10811081
promoteTo('LTS-2024', () => {
10821082
removeLicenseKey(() => {
@@ -1089,7 +1089,7 @@ describe('Working with packages', function () {
10891089
});
10901090
});
10911091
});
1092-
1092+
10931093
it('fails without license when package is only in base-2025', function (done) {
10941094
promoteTo('base-2025', () => {
10951095
removeLicenseKey(() => {
@@ -1102,7 +1102,7 @@ describe('Working with packages', function () {
11021102
});
11031103
});
11041104
});
1105-
1105+
11061106
it('succeeds with valid license when package is only in base-2025', function (done) {
11071107
promoteTo('base-2025', () => {
11081108
addLicenseKey(validLicenseKey, () => {
@@ -1115,7 +1115,7 @@ describe('Working with packages', function () {
11151115
});
11161116
});
11171117
});
1118-
1118+
11191119
it('fails with expired license when package is only in base-2025', function (done) {
11201120
promoteTo('base-2025', () => {
11211121
addLicenseKey(expiredLicenseKey, () => {
@@ -1128,7 +1128,7 @@ describe('Working with packages', function () {
11281128
});
11291129
});
11301130
});
1131-
1131+
11321132
it('succeeds without license when package is in LTS-2024 and base-2025', function (done) {
11331133
promoteTo('LTS-2024', () => {
11341134
promoteTo('base-2025', () => {
@@ -1145,7 +1145,7 @@ describe('Working with packages', function () {
11451145
});
11461146
});
11471147
});
1148-
1148+
11491149
it('succeeds with valid license when package is in LTS-2024 and base-2025', function (done) {
11501150
promoteTo('LTS-2024', () => {
11511151
promoteTo('base-2025', () => {
@@ -1162,7 +1162,7 @@ describe('Working with packages', function () {
11621162
});
11631163
});
11641164
});
1165-
1165+
11661166
it('succeeds with expired license when package is in LTS-2024 and base-2025', function (done) {
11671167
promoteTo('LTS-2024', () => {
11681168
promoteTo('base-2025', () => {
@@ -1179,7 +1179,7 @@ describe('Working with packages', function () {
11791179
});
11801180
});
11811181
});
1182-
1182+
11831183
it('succeeds without license when package is in stable and not in base-2025', function (done) {
11841184
promoteTo('stable', () => {
11851185
removeLicenseKey(() => {
@@ -1192,7 +1192,7 @@ describe('Working with packages', function () {
11921192
});
11931193
});
11941194
});
1195-
1195+
11961196
it('fails without license when package is in stable and base-2025', function (done) {
11971197
promoteTo('stable', () => {
11981198
promoteTo('base-2025', () => {
@@ -1209,7 +1209,7 @@ describe('Working with packages', function () {
12091209
});
12101210
});
12111211
});
1212-
1212+
12131213
it('succeeds with valid license when package is in stable and base-2025', function (done) {
12141214
promoteTo('stable', () => {
12151215
promoteTo('base-2025', () => {
@@ -1226,7 +1226,7 @@ describe('Working with packages', function () {
12261226
});
12271227
});
12281228
});
1229-
1229+
12301230
it('fails with expired license when package is in stable and base-2025', function (done) {
12311231
promoteTo('stable', () => {
12321232
promoteTo('base-2025', () => {
@@ -1243,8 +1243,8 @@ describe('Working with packages', function () {
12431243
});
12441244
});
12451245
});
1246-
1247-
});
1246+
1247+
});
12481248

12491249
describe('Other functions', function () {
12501250
it('lists all the channels a package is in', function (done) {
@@ -1281,7 +1281,7 @@ describe('Working with packages', function () {
12811281
});
12821282
});
12831283

1284-
// TODO supposed to be 404, but receiving an ampty array
1284+
// TODO supposed to be 404, but receiving an ampty array
12851285
it('unauthenticated users cannot view private package channels', function (done) {
12861286
request.get(`/depot/pkgs/neurosis/testapp/0.1.3/${release2}/channels`)
12871287
.type('application/json')
@@ -1334,7 +1334,7 @@ describe('Working with packages', function () {
13341334
});
13351335
});
13361336

1337-
// TODO supposed to be 404, but receiving an ampty array
1337+
// TODO supposed to be 404, but receiving an ampty array
13381338
it('does not let members of the other origin to view private package channels', function (done) {
13391339
request.get(`/depot/pkgs/neurosis/testapp/0.1.3/${release2}/channels`)
13401340
.type('application/json')

0 commit comments

Comments
 (0)