Skip to content

fix(ie): Use 32-bit version by default for IEDriver #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 5, 2017

Conversation

cnishina
Copy link
Contributor

closes #180

Copy link
Contributor

@sjelin sjelin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple questions.

@@ -153,7 +154,7 @@ function start(options: Options) {
path.resolve(outputDir, binaries[GeckoDriver.id].executableFilename(osType)));
}
if (downloadedBinaries[IEDriver.id] != null) {
if (options[Opt.IE32].getBoolean()) {
if (options[Opt.IE32].getBoolean() || options[Opt.IE].getBoolean()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or IE64?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This conditional sets the architecture to 32-bit. By default it is the system's arch which is probably x64.

let binary = binaries[IEDriver.id];
binary.arch = Config.osArch(); // Win32 or x64
updateBrowserFile(binary, outputDir);
promises.push(updateBinary(binary, outputDir, proxy, ignoreSSL));
}
if (ie32) {
if (ie || ie32) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if ((ie && !ie64) || ie32)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ie, ie32, and ie64 are set from different flag options.

An example: a user downloads the 32bit version:

webdriver-manager update --ie

ie = true
ie32 = false
ie64 = false

webdriver-manager update --ie32

ie = false
ie32 = true
ie64 = false

An odd case: the user wants to download the 32bit version and 64bit version. We will let them download both. However, starting the server, the user would then have to specify if they want to use the 32-bit version if not it would default to the system arch.

webdriver-manager update --ie32 --ie64

ie = false
ie32 = true
ie64 = true

@@ -122,7 +122,9 @@ export class FileManager {
}
// if the suffix does not match the executable,
// the binary is something like: .exe and .zip
else if (existFile.indexOf(binary.suffix(osType, arch)) === -1) {
else if (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an extra check... current implementation of this needs some fixing. This is because downloading a file before 2.23 suffix is mac32.zip and this method is returning mac64.zip. Unfortunately, when we get the suffix the version is not set.

Not having extra checks:

webdriver-manager status

chromedriver versions available: 2.20 [last], 2.20mac32.zip, 2.26 [default]

Adding a TODO(cnishina) to fix this.

@@ -18,8 +18,6 @@ describe('status', () => {
// geckodriver {{config version}} [last] [default]
// standalone 2.24 [last], {{config version}} [default]
beforeAll((done) => {
Config.osType_ = 'Linux';
Config.osArch_ = 'x64';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not matter which os arch and type we are downloading.

opts[IE32] = new Option(IE32, 'Install or update 32-bit ie driver', 'boolean', IEDriver.isDefault);
opts[IE64] = new Option(IE64, 'Install or update x64 iedriver', 'boolean', IEDriver.isDefault);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the default be IEDriver.is64Default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isDefault is a boolean to either to download or not download. The arch version is decided elsewhere.

@cnishina cnishina force-pushed the fix_ie branch 2 times, most recently from 225cd9a to c9089da Compare December 27, 2016 22:05
opts[IE] = new Option(IE, 'Install or update ie driver', 'boolean', IEDriver.isDefault);
opts[IE32] = new Option(IE32, 'Install or update 32-bit ie driver', 'boolean', IEDriver.isDefault);
opts[IE] = new Option(
IE, 'Install or update ie driver (defaults downloading 32-bit version)', 'boolean',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a default - always 32 bit.

@@ -74,12 +74,16 @@ function update(options: Options): Promise<void> {
let gecko = options[Opt.GECKO].getBoolean();
let ie: boolean = false;
let ie32: boolean = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why two variables if they're just gonna be the same thing anyway? Combine both into ie32

@@ -46,6 +46,7 @@ if (Config.osType() === 'Windows_NT') {
prog.addOption(Opts[Opt.VERSIONS_IE])
.addOption(Opts[Opt.IE32])
.addOption(Opts[Opt.IE])
.addOption(Opts[Opt.IE64])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per our discussion offline, remove the IE and IE32 flags and default arch to Win32

@cnishina cnishina force-pushed the fix_ie branch 2 times, most recently from d2065da to 9903d6c Compare December 28, 2016 19:45
@cnishina
Copy link
Contributor Author

cnishina commented Jan 4, 2017

@sjelin ping... for review.

@@ -10,7 +10,8 @@ export class IEDriver extends Binary {
static os = [OS.Windows_NT];
static id = 'ie';
static versionDefault = Config.binaryVersions().ie;
static isDefault = false;
static isDefault32 = false;
static isDefault64 = false;
static shortName = ['ie', 'ie32'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the short names be ['ie', 'ie64'] now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you imagine that. shortName is not used at all. I must have had it there for something and abandoned it. Removing all shortName's. 😕

Copy link
Contributor

@sjelin sjelin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh actually see my shortName changes

@@ -21,7 +21,6 @@ export interface BinaryMap<T extends Binary> { [id: string]: T; }
export class Binary {
static os: OS[]; // the operating systems, the binary can run on
static id: string; // the binaries key identifier
static isDefault: boolean; // to download by default
static versionDefault: string; // a static default version variable
static shortName: string[]; // the names used for a binary download
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If shortName is gone remove it here too. Please do a grep too do double check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visual grep failed. Will fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it looks like I didn't commit that code... fixed now.

@cnishina cnishina merged commit 70614a2 into angular:master Jan 5, 2017
@cnishina cnishina deleted the fix_ie branch January 7, 2017 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use 32-bit version by default for IEDriver
3 participants