iliana / rust-crowbar

Wrapper to simplify writing AWS Lambda functions in Rust (using the Python execution environment)
https://docs.rs/crowbar
Apache License 2.0
197 stars 16 forks source link

Implement local testing (#13) #16

Closed ChristopherMacGown closed 6 years ago

iliana commented 6 years ago

I feel like I should just be able to run make test and Make should compile the examples before running the test commands. Is that an improvement you'd like to write?

ChristopherMacGown commented 6 years ago

Yep, I can do that. It will probably take a Makefile in each example directory to make the recursive build work properly. Is that ok?

iliana commented 6 years ago

Hm. Would cd examples/echo; cargo build --release work too?

If all that's happening is execing cargo in a directory I'm not particularly thrilled about there being a Makefile there too (especially since the example dirs are designed as much as possible to be cargo culted to new projects).

ChristopherMacGown commented 6 years ago

I've moved the Makefile out of the root of the repo into test/ and split it up into two sub-Makefiles Makefile.local and Makefile.docker. The .local version allows you to build and test the examples locally, and the .docker version builds them via the docker builder and tests them against amazonlinux:latest.

I also added a commit that removes the PYENV references from builder/build.sh because that fails as well due to the unbound variable.

iliana commented 6 years ago

I also added a commit that removes the PYENV references from builder/build.sh because that fails as well due to the unbound variable.

oh whoops. :(

I'll hopefully be able to test and merge this tonight.

iliana commented 6 years ago

I'm actually going to go ahead and merge #18 which will mark this PR as conflicting with the master branch, but I can fix that myself later tonight if all goes smoothly.

ChristopherMacGown commented 6 years ago

No worries, I dropped the conflicting commit.