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

RegEx Lookup and Improved RegEx #412

Merged
merged 3 commits into from
Nov 3, 2016
Merged

Conversation

neha-viswanathan
Copy link
Contributor

@neha-viswanathan neha-viswanathan commented Nov 3, 2016

Ref #387

Added regex-lookup.yml containing a dictionary of regular expressions used in the test runner. Also updated the regular expressions for better pattern matching.

The earlier version of regular expressions was limited to matching the pattern of the first row of the output. The updated regex matches the pattern of the entire output that is returned.

To test:

go test github.com/appcelerator/amp/cmd/amp/cli

service-remove: ([a-z]+)
stack-create: ([a-z0-9]){64}
stack-list: NAME\s+ID\s+STATE\s*-+\s*\n+([a-z0-9A-Z\s]*){1,}
stack-stop: ([a-z0-9]){64}
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of [stack-create, stack-stop, stack-restart] it should be just a single stack-id
The same for service-id

func TestCmds(t *testing.T) {
_, err := loadRegexLookup()
Copy link
Contributor

Choose a reason for hiding this comment

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

You never use the []*LookupSpec

return
}

func loadRegexLookup() ([]*LookupSpec, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

So you can remove it here

}

//Parse regex-lookup.yml using a map
func parseLookup(file string) (*LookupSpec, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

and here

@generalhenry generalhenry merged commit bd8dfb2 into master Nov 3, 2016
@generalhenry generalhenry deleted the cli-test-retry-timeout branch November 3, 2016 20:44
@neha-viswanathan neha-viswanathan added this to the 0.3.0 milestone Nov 7, 2016
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