Closed (fixed)
Project:
Drupal.org BDD
Version:
6.x-1.x-dev
Component:
Step definitions
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
31 Jul 2012 at 17:49 UTC
Updated:
7 Dec 2012 at 10:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
kssundar commentedTaking this up and tagging
Comment #2
kssundar commentedThis feature is created and attached is the patch.
The patch will add a few parameters to the yml file. You might have to configure the following parameters:
ssh key -> title (This is the ssh key title on which Delete/Edit operations have to be performed)
ssh key -> valid (Provide a valid ssh key - Dont forget to provide the title at the end of the key & title should be same as ssh key -> title)
ssh key -> invalid (Provide an invalid ssh key)
Sample parameters have been added in the patch as well. Some scenarios may fail if ssh key you entered already exists.
Comment #3
kssundar commentedAttaching patch here :)
Comment #4
eliza411 commentedReally glad to see this get underway!
Ultimately we'll need this test to have pub/private keys on the CI server and for developers running tests on demand. This seems like a great start, but I think we might consider creating the key as part of the test setup, and if that's not platform agnostic, then tagging these tests @linux or something.
@halstead, can you weigh in here.
Comment #5
kssundar commentedAnything here? :)
Comment #6
eliza411 commentedThanks for reminding me.
Now that you've been working with the command-line, can this test be written to both produce and upload keys? It may limit the test to being run on a linux system, and that's okay.
I'll open a separate issue regarding the provision of keys for git user and git vetted user for push/pull tests.
Comment #7
eliza411 commentedunassigning.
Comment #8
kssundar commentedtagging
Comment #9
kssundar commentedFeature created and committed here - http://drupalcode.org/project/doobie.git/commit/75d5758
I have tagged scenarios as @linux
Also, Process->run() did not work for generating ssh keys as it required user interaction. So I used exec().
Comment #10
eliza411 commentedI'm still being prompted for interaction.
Also, we should not delete an existing key with a default name. I among others use id_rsa as my main key.
ssh-keygen -f filenameshould let you specify the key name)Comment #11
kssundar commentedOops! I forgot to mention that the file is being removed. Apologies for that :(
I am trying to use this command:
"ssh-keygen -f \"$sshFile\" -N \"$pass\" -t rsa -C \"$title\"";The above command will take filename and password in a single shot and does not require any user interaction. The newly generated ssh keys will be stored in 'files' folder.
Can we delete the newly generated ssh files after the scenario?
Comment #12
eliza411 commentedIf the step definition is using a random string, I think it's fine to delete the key.
Comment #13
kssundar commentedUpdated the ssh key generating logic and it now does not ask for any user interaction. Also, changed 'exec()' to 'Process->run()'.
Committed here - http://drupalcode.org/project/doobie.git/commit/0115207
Comment #14
eliza411 commentedI'm getting
PHP Fatal error: Call to a member function getHTML() on a non-object in /home/melissa/doobie/features/bootstrap/FeatureContext.php on line 385I think this is because of the broken nature of git6 right now, but I think we need better exception handling as this kind of broken is clearly something we can expect.
Comment #15
eliza411 commentedConsider the following changes to produce a clear given/when/then structure:
As a git vetted user
I should see the Projects section in my profile page
Background:
Given I am logged in as "git vetted user"
Scenario: View the Projects section
When I visit "/user"
Then I should see the heading "Projects"
And I should see "Total:"
And I should see "commits)"
And I should see the link "SSH keys"
@gitrepo
Scenario: Create a sandbox project and initialize repo
When I visit "/node/add/project-project"
And I create a "module"
And I see the project title
And I am on the Version control tab
And I initialize the repository
Then I should see {test something here}
@gitrepo
Scenario: Commit to the above sandbox project
When I visit the Version control tab
And I clone the repo
And I push a commit to the repository
And I push one more commit to the repository
Then I should see the project link
And I should see "2" commits for the project
@gitrepo
Scenario: Promote the sandbox project and commit
When I visit the project page
And I promote the project
And I follow "Version control"
And I clone the repo
And I push a commit to the repository // If it's not too complicated can we combine this
And I push one more commit to the repository // with this
To something more like:
And I push "X" commit(s) to the repository
Then I should see the project link
And I should see "4" commits for the project <- This introduces an unnecessary dependency
@gitrepo
Scenario: Create a full project and commit
When I visit "/node/add/project-project"
And I create a full project
And I follow "Version control"
And I initialize the repository
And I follow "Version control"
And I push a commit to the repository
Then I should see the project link
And I should see "1" commit for the project
Comment #16
eliza411 commentedUnassigning
Comment #17
kssundar commentedI think the comments #14 and #15 belong to the issue #1706782: Profile (/user) and the issue in this page still needs review. :)
Comment #18
kssundar commentedtagging
Comment #19
eliza411 commentedLooks good to me ... sorry about posting comments on the wrong issue!
Comment #20
jhedstromCode changes look good, tests are passing.
Comment #21
eliza411 commentedmerged to master
Comment #23
pradeeprkara commentedThis is ported to 7.x branch.
http://drupalcode.org/project/doobie.git/commit/266134e
Comment #23.0
pradeeprkara commented.