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

Refactor some spec infrastructure #1308

Merged
merged 6 commits into from
Nov 29, 2018
Merged

Refactor some spec infrastructure #1308

merged 6 commits into from
Nov 29, 2018

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented Nov 16, 2018

No description provided.

For consistency, all derived attributes are now written as methods,
rather than having some written as attr_readers and some as methods.
This adds a lot of complexity for no use-case that I can see. All
specs always live in spec/.
TestCase now just represents the expectations of a given test case as
written to the filesystem, and it's SassSpecRunner's job to actually
run the implementation and verify its output.
This allows us to remove TestCase.result?, making TestCase entirely
unmodifiable.
These were only used in one place, so it makes more sense to just
manually put them there.
@nex3 nex3 requested a review from nschonni November 16, 2018 01:20
Copy link
Contributor

@nschonni nschonni left a comment

Choose a reason for hiding this comment

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

node-sass should be fine with this, but I'm not 💯 with the other libsass variants

@@ -42,24 +42,7 @@ def run
Minitest.reporter = Minitap::TapY
end

result = Minitest.run(minioptions)

if @options[:run_todo]
Copy link
Contributor

Choose a reason for hiding this comment

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

Think this is actually useful, since I think @xzyfer runs this to find what is passing in libsass, but I'll let him chime in
Can't recall if this just shadowed the probe_todo though

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's a big pain in the ass to support, so it might be worth altering workflows for. You can still find passing TODO tests using --interactive --probe-todo.

@@ -103,13 +103,6 @@ def self.parse
options[:only_output_styles] << style
end

opts.on("-r SPEC_DIR", "--root SPEC_DIR", "Root directory for the specs. ",
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure spec directory is used by some of the libsass variants when skimming through https://github.com/search?p=1&q=org%3Asass+sass-spec&type=Code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see some stuff about configuring the location of the sass-spec gem itself, but nothing about using the --root flag.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have any insight into how our wrappers do their tests. We'd have to ask them cc @bolandrm @asottile @mgreter

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

More generally: do any wrappers (other than Node Sass) use sass-spec in any kind of special way other than just invoking sass-spec with --command and --impl?

Copy link
Contributor

@mgreter mgreter Nov 27, 2018

Choose a reason for hiding this comment

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

Not possible since it would break the whole concept of cpan tests which mostly doesn't have ruby installed and also relies sometimes on GCC 4.4 : http://matrix.cpantesters.org/?dist=CSS-Sass%203.4.10

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, I guess consider this a heads-up that there will be some pretty substantial changes in test format coming soon.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, not that I like to rewrite it for the third time ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's why I was hoping it could re-use the Ruby runner 😞. Another solution would be to just not run the language specs, since it's just a wrapper and LibSass already tests its language implementation thoroughly.

Copy link
Contributor

@mgreter mgreter Nov 28, 2018

Choose a reason for hiding this comment

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

I understand, but the cpan test matrix actually did uncover a few quirks here and there already which weren't caught by libsass CI before and it's always a good feeling when it passed the full matrix.

@nex3
Copy link
Contributor Author

nex3 commented Nov 28, 2018

It sounds like the major wrappers either use custom runners or don't run sass-spec at all, so I don't think this will break them. @nschonni or @xzyfer can I get an approval?

Copy link
Contributor

@nschonni nschonni left a comment

Choose a reason for hiding this comment

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

fine from me, not sure if @xzyfer has any other usages of the removed flags

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.

5 participants