-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Auto eclcc seleciton based on build version
Signed-off-by: Gordon Smith <gordonjsmith@gmail.com>
- Loading branch information
1 parent
64d36be
commit 208bb5d
Showing
4 changed files
with
137 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,64 @@ | ||
import { expect } from "chai"; | ||
import { isBrowser } from "../testLib"; | ||
|
||
import { locateClientTools } from "@hpcc-js/comms"; | ||
import { locateClientTools, Version } from "@hpcc-js/comms"; | ||
|
||
function test(build: string, prefix: string, major: number, minor: number, patch: number, postfix: string): boolean { | ||
const version = new Version(build); | ||
return version.prefix === prefix && version.major === major && version.minor === minor && version.patch === patch && version.postfix === postfix; | ||
} | ||
|
||
function logVersion(build: string): Promise<void> { | ||
return locateClientTools("", build).then(ct => { | ||
return ct.version().then(version => { | ||
console.log(`${build} => ${version.toString()}`); | ||
}); | ||
}); | ||
} | ||
|
||
describe("eclcc", function () { | ||
it.only("basic", function () { | ||
if (!isBrowser()) { | ||
if (!isBrowser()) { | ||
it("basic", function () { | ||
expect(locateClientTools).to.be.a("function"); | ||
return locateClientTools().then(clienttools => { | ||
}).catch(e => { | ||
// No eclcc on travis... | ||
}); | ||
} | ||
}); | ||
}); | ||
|
||
it("version", function () { | ||
expect(test("10.11.12", "", 10, 11, 12, "")).to.be.true; | ||
expect(test("community_4.0.0-9rc", "community", 4, 0, 0, "9rc")).to.be.true; | ||
expect(test("community_4.0.0-rc9", "community", 4, 0, 0, "rc9")).to.be.true; | ||
expect(test("community_4.0.0-rc9[abc]", "community", 4, 0, 0, "rc9[abc]")).to.be.true; | ||
expect(test("community_4.0.0-rc9[community_4.0.0-rc9-4-g826364-dirty]", "community", 4, 0, 0, "rc9[community_4.0.0-rc9-4-g826364-dirty]")).to.be.true; | ||
expect(test("community_54.10.10", "community", 54, 10, 10, "")).to.be.true; | ||
expect(test("6.4.14 community_6.4.14-1", "community", 6, 4, 14, "1")).to.be.true; | ||
}); | ||
|
||
it("version compare", function () { | ||
const version5_6_8 = new Version("5.6.8"); | ||
const version6_6_8 = new Version("6.6.8"); | ||
expect(version5_6_8.compare(version6_6_8)).to.be.lessThan(0); | ||
expect(version6_6_8.compare(version5_6_8)).to.be.greaterThan(0); | ||
expect(version6_6_8.compare(version6_6_8)).to.equal(0); | ||
const version6_6_8rc1 = new Version("6.6.8-rc1"); | ||
expect(version6_6_8.compare(version6_6_8rc1)).to.greaterThan(0); | ||
const version5_6_8rc1 = new Version("5.6.8-rc1"); | ||
const version5_6_8rc2 = new Version("5.6.8-rc2"); | ||
expect(version5_6_8rc1.compare(version5_6_8rc2)).to.lessThan(0); | ||
}); | ||
|
||
it.skip("eclcc locate", function () { | ||
return Promise.all([ | ||
logVersion("comms_60.60.0"), | ||
logVersion("comms_6.18.0"), | ||
logVersion("comms_6.13.0"), | ||
logVersion("comms_6.6.0"), | ||
logVersion("comms_6.0.0"), | ||
logVersion("comms_5.10.0"), | ||
logVersion("comms_5.0.0") | ||
]); | ||
}); | ||
} | ||
}); |