-
Notifications
You must be signed in to change notification settings - Fork 152
Fix Ignore Patterns. Add .git to Ruby workflow. #130
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
Conversation
|
So it appears some tests fail would you rather I keep the splat on |
|
OK, I reverted the |
|
Do you have an example of a failing test, even a failing integration test, that would illustrate what is broken and the fix working? This looks fine on the surface, just want to have something we can use to avoid regressions. |
|
Good question. I suspect I can copy this test from the java maven workflow (https://github.com/awslabs/aws-lambda-builders/blob/develop/tests/unit/workflows/java_maven/test_workflow.py#L46-L53) and use it in the Ruby/Bundler one. Cause right now there is no test for the |
|
Hmmm... those tests seem a bit tautological and not an integration test. Just tests that a constant is set. What do you think? |
|
Part of that test should also be that the build action completed successfully. Then you can check for some example files that you'd know would be generated. Ruby has a few "example apps" that turn into these types of tests - for example: https://github.com/awslabs/aws-lambda-builders/tree/develop/tests/integration/workflows/ruby_bundler/testdata/with-deps Can we add an example app that breaks the build, and show this change fixing said build? |
I do not really have the Python skills for that. Are there any tests like that already that I can copy that you can point me too? At quick glance, I did not see any integration tests that checked for excluded files. So my questions are.
|
|
I think I can meet you halfway if you can provide the Ruby application which breaks the build, and I can create the test. Put it in a folder like the one I linked. Test format is here but I'm happy to write it: https://github.com/awslabs/aws-lambda-builders/blob/develop/tests/integration/workflows/ruby_bundler/test_ruby.py |
Thanks so much for that offer! I had some free time tonight and got this done. The latest commit adds an "excluded-files" test app which is really just a copy of "no-deps" app with two directories added, a From here it was easy to test since the format of the previous test was grok'able by me even tho I do not work in Python. I even verified (locally) that if the change submitted to this pull request was not done, the submitted test would fail with the following error. Again, I'd like to point out why. A co-worker showed me via this site (https://repl.it/languages/python3) that the code prior was never working because it was a string, not a tuple. |
|
Thanks for this! As a bonus, I think a couple of other builders have this same issue, so I'll apply this to those as well. |
Ok, so this is really weird. I have been using the lambic/lambda containers to run
sam buildinside it vs usingsam build --use-containerfrom outside. I am using the Ruby 2.5 workflow with my open source Lamby (https://github.com/customink/lamby) project.So... I found out when doing my sam builds in a container that I ran into a recursive
.aws-sam/build/RailsFunction/.aws-sam/build/RailsFunction/...issue. After a TON of digging I found thatignored_nameshere https://github.com/awslabs/aws-lambda-builders/blob/develop/aws_lambda_builders/utils.py#L45 was an empty set even tho I could print thesourceandnamesand see an.aws-samdirectory there.I found there were two ways to work around this issue. Neither I know not why and have included both changes. My guess is the reverse splat (is that the python name too) is the core issue and was only an issue for Ruby beaus we only had one item in our set. So adding
.gitfixes it too... and that in itself is a good addition. But wanted to include both in this PR.Also note that Python is not my native language and I am hacking here. Feedback appreciated.