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

Fixed runtime container working directory bug #74

Merged
merged 3 commits into from
Aug 18, 2017
Merged

Fixed runtime container working directory bug #74

merged 3 commits into from
Aug 18, 2017

Conversation

PaulMaddox
Copy link
Contributor

Fixed runtime container working directory that caused it to be an empty string if the CodeUri was set to something that wasn't a valid directory.

Wrote a load of test cases for working directory related stuff to prevent future regressions.

Fixes #22

Running Suite: AwsSamLocal Suite
================================
Random Seed: 1503044376
Will run 52 of 52 specs

••••••••••••••••••••••••••••••••••••••••••••••••••••
Ran 52 of 52 Specs in 0.018 seconds
SUCCESS! -- 52 Passed | 0 Failed | 0 Pending | 0 Skipped PASS

Ginkgo ran 1 suite in 1.255006227s
Test Suite Passed

string if the CodeUri was set to something that wasn't a valid
directory.

Wrote a load of test cases for working directory related stuff to
prevent future regressions.

Fixes #22
@PaulMaddox PaulMaddox requested review from pesama and sanathkr August 18, 2017 08:21
@@ -584,7 +584,7 @@ func getWorkingDir(basedir string, codeuri string, checkWorkingDirExist bool) (s
if _, err := os.Stat(dir); err != nil {
// It doesn't, so just use the directory of the SAM template
// which might have been passed as a relative directory
dir = basedir
dir = abs
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the cause of the bug.
If the base directory was empty (e.g. if they called --template filename.yaml), and the CodeUri wasn't a valid relative directory that exists, then instead of returning the current working directory, it returned "".

@sanathkr
Copy link
Contributor

Travis build 👍🏼

@sanathkr sanathkr merged commit 8b0d21b into aws:develop Aug 18, 2017
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