Skip to content

Skip tests that fail on windows and enable all the rest#3035

Merged
kripken merged 14 commits into
masterfrom
wintest
Aug 11, 2020
Merged

Skip tests that fail on windows and enable all the rest#3035
kripken merged 14 commits into
masterfrom
wintest

Conversation

@kripken

@kripken kripken commented Aug 10, 2020

Copy link
Copy Markdown
Member

This lets us run most tests at least on that platform.

Add a new function for skipping those tests, skip_if_on_windows,
so that it's easy to find which tests are disabled on windows for later fixing
efforts.

This fixes a few minor issues for windows, like comparisons
should ignore \r in some cases.

@kripken kripken changed the title Skip tests that fail on windows Skip tests that fail on windows and enable all the rest Aug 10, 2020

@aheejin aheejin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are _dwarf added to test file names..? Do we have a pass called --dwarf?

Comment thread scripts/test/shared.py
if get_platform() == 'windows':
print('skipping test "%s" on windows' % name)
return True
return False

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Doesn't this mean we don't run anything on Windows? Is this only a placeholder for now and are we planning to add real conditions here later? If so, where is this supposed to be used? Currently it seems it is used only in spec tests and wasm-opt pass tests... Is there a guideline where we should use this or not?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The idea is that this would be called when we know a test currently fails on windows. It just returns true/false so it's up to the calling code to actually skip the test.

I plan to use it in this PR to disable all failing windows tests, which should let us enable the majority of tests at least (I hope).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What I meant was, this returns True for everything on Windows now even without checking names.. So do you mean this is a placeholder for now and you are gonna add real file names later?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No, this is the actual function. It's only called when we should definitely skip what we are currently doing if we are on windows. So the caller decides which test or part of a test to skip, and this just logs and returns True, and provides a simple way to search for all windows skips.

See e.g. the wasm2js test change https://github.com/WebAssembly/binaryen/pull/3035/files#diff-611fb24eb3395253b8c42c20f7238e8e

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh, I see. Thanks. I was confused.

Comment thread check.py
base = os.path.basename(wast)
print('..', base)
# windows has some failures that need to be investigated
if base == 'names.wast' and shared.skip_if_on_windows('spec: ' + base):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why skip names.wast? If this is not something windows-related, we have something similar in shared.py:

SPEC_TEST_BLACKLIST = [
# Stacky code / notation
'block.wast',
'call.wast',
'float_exprs.wast',
'globals.wast',
'loop.wast',
'nop.wast',
'select.wast',
'stack.wast',
'unwind.wast',
# Binary module
'binary.wast',
'binary-leb128.wast',
'custom.wast',
# Empty 'then' or 'else' in 'if'
'if.wast',
'local_set.wast',
'store.wast',
# No module in a file
'token.wast',
'utf8-custom-section-id.wast',
'utf8-import-field.wast',
'utf8-import-module.wast',
'utf8-invalid-encoding.wast',
# 'register' command
'imports.wast',
'linking.wast',
# Misc. unsupported constructs
'call_indirect.wast', # Empty (param) and (result)
'const.wast', # Unparenthesized expression
'data.wast', # Various unsupported (data) notations
'elem.wast', # Unsupported 'offset' syntax in (elem)
'exports.wast', # Multiple inlined exports for a function
'func.wast', # Forward named type reference
'skip-stack-guard-page.wast', # Hexadecimal style (0x..) in memory offset
# Untriaged: We don't know the cause of the error yet
'address.wast', # wasm2js 'assert_return' failure
'br_if.wast', # Validation error
'float_literals.wast', # 'assert_return' failure
'int_literals.wast', # 'assert_return' failure
'local_tee.wast', # Validation failure
'memory_grow.wast', # 'assert_return' failure
'start.wast', # Assertion failure
'type.wast', # 'assertion_invalid' failure
'unreachable.wast', # Validation failure
'unreached-invalid.wast' # 'assert_invalid' failure
]
options.spec_tests = [t for t in options.spec_tests if os.path.basename(t) not
in SPEC_TEST_BLACKLIST]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hmm, maybe it should be added to that list then, good point. It's windows-specific but we could append it when on that platform. However, then we can't use the skip_if_on_windows function which otherwise would be a single easy way to find all skipped stuff in windows... what's better?

@aheejin aheejin Aug 10, 2020

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh, sorry, I didn't see names.wast is skipped only on Windows.. I thought it was an 'or' condition, so I thought the condition was if it is names.wast or it is on Windows. This part of the code excludes failing tests from the list of spec tests, so if we add some platform handling logic I think we can make those files be excluded from here. But if we have only a single case of names.wast that is platform-dependent, I'm not sure that's worth it. Also this list is only for spec tests, so maybe it'd be better to keep them separate after all, unless we make a more complex system of skipping tests that takes the platform and the kind of tests as arguments, which seems like an overkill.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Seems like overkill to me too, to try to generalize this. I don't feel strongly, but I think I prefer the current status of the code.

@kripken

kripken commented Aug 10, 2020

Copy link
Copy Markdown
Member Author

@aheejin There is a pass called "dwarfdump" which prints out the DWARF, and is what we need to skip on windows for now.

@aheejin

aheejin commented Aug 10, 2020

Copy link
Copy Markdown
Member

@aheejin There is a pass called "dwarfdump" which prints out the DWARF, and is what we need to skip on windows for now.

Sorry I still don't understand how it is related to the file renaming..

@kripken

kripken commented Aug 10, 2020

Copy link
Copy Markdown
Member Author

Oh, the name of the test may not contain the passes we run. So I renamed tests that contain a call to --dwarfdump to contain dwarf in the name. That seems clearer anyhow I think, aside from making it easy to skip the dwarf tests here.

@kripken

kripken commented Aug 10, 2020

Copy link
Copy Markdown
Member Author

Ok, I think the work here is done - I had to disable a bunch of things like wasm2js and unit tests, but the majority do pass now.

Comment thread scripts/test/shared.py
# delete the old file, make sure you rename the corresponding .wast.log file in
# expected-output/ if any.
SPEC_TEST_BLACKLIST = [
SPEC_TESTS_TO_SKIP = [

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! I forgot we still had this.

Comment thread scripts/test/shared.py
if get_platform() == 'windows':
print('skipping test "%s" on windows' % name)
return True
return False

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh, I see. Thanks. I was confused.

Comment thread test/unit/utils.py

# similar to assertEqual, but while ignoring line ending differences such
# as those between windows and unix
def assert_equal_ignoring_line_endings(self, left, right):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't need to replace other usages of assert_equal with this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think we would need to audit each one to see if line endings should be ignored there or not. That may explain some of the remaining failures in unit, but not the first few at least (which is when I gave up on trying to fix them all).

@kripken kripken merged commit f067a45 into master Aug 11, 2020
@kripken kripken deleted the wintest branch August 11, 2020 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants