eecs485staff / madoop

A light weight MapReduce framework for education
MIT License
9 stars 4 forks source link

Support non-Python executables #35

Closed jaredzh closed 2 years ago

jaredzh commented 2 years ago

Change the test for sane executables to tolerate non-Python programs.

Closes #23

codecov[bot] commented 2 years ago

Codecov Report

Merging #35 (7d43e64) into develop (d2e33fa) will increase coverage by 0.70%. The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #35      +/-   ##
===========================================
+ Coverage    93.28%   93.98%   +0.70%     
===========================================
  Files            4        4              
  Lines          134      133       -1     
===========================================
  Hits           125      125              
+ Misses           9        8       -1     
Impacted Files Coverage Δ
madoop/mapreduce.py 95.37% <100.00%> (+0.87%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d2e33fa...7d43e64. Read the comment docs.

jaredzh commented 2 years ago

Looks great! I made a few minor changes. Would you please add some unit tests?

  • [ ] Executable that returns non-zero
  • [ ] Executable with a messed up shebang.
  • [ ] Non-Python executable (maybe Bash word count?)

Yeah, I can do that real quick.

awdeorio commented 2 years ago

While you're at it, might as well make the exes and output consistent with the published example.

On Fri, Dec 3, 2021 at 3:49 PM Jared Zhang @.***> wrote:

@.**** commented on this pull request.

In tests/test_api.py https://github.com/eecs485staff/madoop/pull/35#discussion_r762238691:

@@ -17,3 +18,40 @@ def test_simple(tmpdir):

     TESTDATA_DIR/"word_count/correct/output",

     tmpdir/"output",

 )

+

+

+def test_bash_executable(tmpdir):

  • """Run a MapReduce job written in Bash."""

  • with tmpdir.as_cwd():

  • madoop.mapreduce(

  • input_dir=TESTDATA_DIR/"word_count/input",

  • output_dir="output",

  • map_exe=TESTDATA_DIR/"word_count/wc_map.sh",

  • reduce_exe=TESTDATA_DIR/"word_count/wc_reduce.sh",

  • )

  • utils.assert_dirs_eq(

  • TESTDATA_DIR/"word_count/correct/output_bash",

Right, don't know why I didn't think of that 😂. Will change it later today.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eecs485staff/madoop/pull/35#discussion_r762238691, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZHZHK3KPCGVR7G2XJNW33UPEUNFANCNFSM5JICE3GQ .

-- http://andrewdeorio.com Computer Science and Engineering Dept. @ The University of Michigan

jaredzh commented 2 years ago

Ok, the bash mappers and reducers now produce the same exact same results as the python ones. Also the example exes and the corresponding output in the spec is consistent now. Lmk what you think. @awdeorio