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

test environment: update aruba/cucumber deps to latest stable #30

Closed
wants to merge 10 commits into from

Conversation

mroth
Copy link
Owner

@mroth mroth commented Apr 19, 2017

while Aruba is still not shipping 1.0 (see #15), making me a bit nervous about the state of the project, it's been long enough that I want to try to get the tests running on latest stable anyhow, so we're in a cleaner state to be prepared, and to work towards starting to get CI working in Windows environments as well.

@mroth mroth changed the title update aruba/cucumber deps to latest stable test environment: update aruba/cucumber deps to latest stable Apr 19, 2017
@@ -73,13 +73,13 @@
system("git commit -m.")
end
end
FileUtils.cp_r MOCK, current_dir
FileUtils.cp_r MOCK, expand_path(".")

Choose a reason for hiding this comment

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

Prefer single-quoted strings when you don't need string interpolation or special symbols.

Copy link
Owner Author

Choose a reason for hiding this comment

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

This is a silly and outdated rule, Hound, but I don't care enough to change your settings right now.

@@ -62,7 +62,7 @@
# want to rerun the same git init every iteration, rather we just copy a fresh
# copy of the mocked directory!
Given(/^I am in the mocked git repository with commited subdirectory and file$/) do
MOCK ||= File.join(current_dir, "..", "mock", "gitsubdir") #needs to be outside of aruba clobber dir
MOCK ||= File.join(expand_path(".."), "mock", "gitsubdir") #needs to be outside of aruba clobber dir

Choose a reason for hiding this comment

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

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Missing space after #.
Line is too long. [102/80]

@mroth mroth self-assigned this Apr 19, 2017
In the past, overriding dirs for the entire test suite was unreliable,
so we only did it for the few tests that absolutely needed to take
place outside of a git repository.

the way we did this in the past seems to have broken, but changing it
globally now seems to actually work, so deprecate the entire notion of
`@outside-repo` tagged tests, and move the Aruba working directory into
`/tmp`, so now all tests should be outside of a git tree unless it’s
one we created ourselves with the tests.
Keeping future Windows compatibilty in mind!
@@ -0,0 +1,15 @@
Aruba.configure do |config|

Choose a reason for hiding this comment

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

Missing frozen string literal comment.

Some of the output is based on expecting the aruba tmpdir is in a
particular path, we should strive to remove as much of that as possible…
step %Q(the stdout from "#{cmd}" should contain "#{filepath}")
end


Choose a reason for hiding this comment

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

Extra blank line detected.

#
Then(/^the stdout from "([^"]*)" should contain the absolute path of "([^"]*)"$/) do |cmd, f|
filepath = expand_path(f)
step %Q(the stdout from "#{cmd}" should contain "#{filepath}")

Choose a reason for hiding this comment

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

Use % instead of %Q.

end

#
# Handle unknown absolute paths in output
#
Then(/^the stdout from "([^"]*)" should contain the absolute path of "([^"]*)"$/) do |cmd, f|

Choose a reason for hiding this comment

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

Line is too long. [93/80]

YOUR RULES ARE ALMOST NEVER WORTHWHILE FOR OUR FEATURE INTEGRATION

Rather, only check the Go code please
on travis this appears to not notice the before step anymore, so since
we are hard-mocking this all, take a brute force approach to initial
creation.
some change in recent version of aruba’s matchers for cucumber has a
poor regex that makes it impossible to use a quotation mark in a test
case… just remove for now, since that can probably be migrated back
into a unit test later anyhow.
@mroth
Copy link
Owner Author

mroth commented Apr 20, 2017

Closer, down to only one failing test...

@mroth
Copy link
Owner Author

mroth commented Apr 20, 2017

I've narrowed this final test down and it appears to be caused by a regression in Aruba. I'm going to update the step with some inline documentation that shows what is happening (and possible hacky workarounds), then file an issue with Aruba and see if anyone has thoughts.

this is to aide in filing an upstream issue with the aruba project
@mroth
Copy link
Owner Author

mroth commented Apr 20, 2017

Issue filed upstream as cucumber/aruba#432. Fingers crossed for a better solution.

@jdelStrother
Copy link
Contributor

Urgh, wish I'd spotted this PR 2 hours ago. I also started work on upgrading cucumber & aruba & fixing tests.

WDYT to this approach to working around cucumber/aruba#432 ?

jdelStrother@e1691b6

@mroth
Copy link
Owner Author

mroth commented Nov 7, 2020

I'm not certain... I believe shells often have subtle differences in how they handle certain things when they detect they are being run in "interactive mode."

As a sidenote, a few years ago I also got about 60-70% progress into writing an entire working replacement for Aruba for the Go-native "godog" cucumber framework. It had a lot of other niceties such as being able to run all the tests in isolated environments that can be run entirely concurrently, making the tests go very fast. One day I'd still like to pick that up again, but haven't had time and it's not relevant to any of the other OSS projects I've been working on nor my day job... (the repo is currently private but let me know if you're interested in it.)

@jdelStrother
Copy link
Contributor

I'm not certain... I believe shells often have subtle differences in how they handle certain things when they detect they are being run in "interactive mode."

It is still running the shell interactively (jdelStrother@e1691b6#diff-98ae2f02b44c253b557b5dd380b1f41f84c353c580b15443c0f25c3e3d1b4c58R109) - the main change is automatically adding an "exit" and the end of the list of commands, followed by waiting for the shell to actually exit.

As a sidenote, a few years ago I also got about 60-70% progress into writing an entire working replacement for Aruba for the Go-native "godog" cucumber framework. It had a lot of other niceties such as being able to run all the tests in isolated environments that can be run entirely concurrently, making the tests go very fast. One day I'd still like to pick that up again, but haven't had time and it's not relevant to any of the other OSS projects I've been working on nor my day job... (the repo is currently private but let me know if you're interested in it.)

Sounds interesting, but like you think I might be too time constrained to actually do much with it 😕

@jdelStrother
Copy link
Contributor

FWIW I rebased this branch & added a command.wait to fix those few failing tests: master...jdelStrother:aruba-update

I tried to update Aruba to the latest version, but versions >= 1 no longer allow you to set the root directory, which is frustrating. Not sure what the best way around that is.

@mroth mroth closed this in #55 Dec 5, 2021
@mroth mroth deleted the aruba-update branch December 5, 2021 17:16
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