Skip to content
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

Fix --test-probe #1365

Merged
merged 2 commits into from
Apr 3, 2019
Merged

Fix --test-probe #1365

merged 2 commits into from
Apr 3, 2019

Conversation

glebm
Copy link
Contributor

@glebm glebm commented Mar 25, 2019

  1. Changes folder to dir.to_s (folder no longer exists).
  2. Changes passing.any? to !passing.empty?, as any? has pitfalls:
    Took me a few minutes to debug when I tried with input_path instead of dir.to_s, and that was returning nil ([nil].any? #=> false).

1. Changes `folder` to `dir.to_s` (`folder` no longer exists).
2. Changes `passing.any?` to `!passing.empty?`, as `any?` has pitfalls:
   Took me a few minutes to debug when I tried with `input_path` that
   was returning `nil` (`[nil].any? #=> false`).
glebm added a commit to glebm/libsass that referenced this pull request Mar 25, 2019
Also:

1. Moves the `normalize*` functions and `rtrim` to a separate object file,
   so that they can be unit tested quickly and easily.
2. Changes `string_to_output` to also replace `\r\n`, fixing Windows tests.
3. Improves other `normalize_*` functions and adds tests.

Refs sass#2843

sass-spec PRs:

1. Bug fixes to make it run: sass/sass-spec#1365
2. Enabling the newly passing tests: sass/sass-spec#1366
xzyfer pushed a commit to sass/libsass that referenced this pull request Mar 25, 2019
Also:

1. Moves the `normalize*` functions and `rtrim` to a separate object file,
   so that they can be unit tested quickly and easily.
2. Changes `string_to_output` to also replace `\r\n`, fixing Windows tests.
3. Improves other `normalize_*` functions and adds tests.

Refs #2843

sass-spec PRs:

1. Bug fixes to make it run: sass/sass-spec#1365
2. Enabling the newly passing tests: sass/sass-spec#1366
@nex3
Copy link
Contributor

nex3 commented Apr 2, 2019

Why does this change libsass/Sáss-UŢF8 to a non-HRX file? It should still run the test as a raw directory.

@glebm
Copy link
Contributor Author

glebm commented Apr 2, 2019

The original bug (sass/libsass#1774) this test was added for involved the interaction of Windows command line path handling (some arcane Windows path NFC normalization stuff); it should be tested with real files, and the actual test uses sassc binary directly for this one (in addition to testing via sass-spec).

@nex3
Copy link
Contributor

nex3 commented Apr 2, 2019

HRX tests are run with real files. The test runner creates a directory named after the HRX file and invokes the Sass compiler against that directory.

@glebm
Copy link
Contributor Author

glebm commented Apr 2, 2019

Right but this test also runs using a real sassc binary (in addition to running via sass-spec).

@glebm
Copy link
Contributor Author

glebm commented Apr 2, 2019

@nex3
Copy link
Contributor

nex3 commented Apr 2, 2019

LibSass's specs shouldn't have such a tightly-coupled dependency on the specific structure of this repo—that's liable to break. I strongly recommend just creating a matching directory in the LibSass repo directly. That's what we do for Dart Sass tests that exercise details of the CLI.

@glebm
Copy link
Contributor Author

glebm commented Apr 2, 2019

I can open a corresponding issue in the libsass repo to do this.
In the meantime, can you please merge this? Later on we can simply revert bae59ca here

@nex3
Copy link
Contributor

nex3 commented Apr 2, 2019

Can you add a TODO to the spec to re-HRXify it when the LibSass issue is fixed?

@glebm
Copy link
Contributor Author

glebm commented Apr 2, 2019

Opened sass/libsass#2854 and added a TODO there (this way re-hrxifying will be a simple git revert, won't need to revert the TODO as well)

@nex3
Copy link
Contributor

nex3 commented Apr 2, 2019

I'd really rather have a TODO here too, so someone doesn't accidentally change this without realizing it'll break LibSass.

@glebm
Copy link
Contributor Author

glebm commented Apr 2, 2019

OK, I'll amend the commit and post here again when done

These 2 files are used to test UTF8 paths directly with sassc
executable, requiring a real directory.

This special handling is required to test fully on Windows (Ruby wrapper
can mask bugs), see sass/libsass#1774.
@glebm
Copy link
Contributor Author

glebm commented Apr 2, 2019

Amended

@xzyfer xzyfer merged commit 368cfed into sass:master Apr 3, 2019
glebm added a commit to glebm/libsass that referenced this pull request Apr 4, 2019
As sass-spec is migrating to HRX, we need to copy this test here so we
can run it directly via `sassc` instead of the sass-spec runner.

Refs sass#2854
Refs sass/sass-spec#1365
xzyfer pushed a commit to sass/libsass that referenced this pull request Apr 5, 2019
As sass-spec is migrating to HRX, we need to copy this test here so we
can run it directly via `sassc` instead of the sass-spec runner.

Refs #2854
Refs sass/sass-spec#1365
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.

3 participants