mirrord icon indicating copy to clipboard operation
mirrord copied to clipboard

Add E2E tests for file operations

Open infiniteregrets opened this issue 2 years ago • 15 comments

With 2.2.0 release, we need e2e tests for the following functions:

  • [x] open
  • [ ] fopen
  • [ ] fdopen
  • [x] openat
  • [x] read
  • [ ] fread
  • [ ] fileno
  • [x] lseek
  • [x] write

infiniteregrets avatar Jun 10 '22 13:06 infiniteregrets

I can start work on this tomorrow!

thedanvail avatar Jun 19 '22 15:06 thedanvail

Amazing, thanks!

eyalb181 avatar Jun 19 '22 18:06 eyalb181

currently, we do have tests for

  • read
  • write
  • open (this is tested through read/write, so we dont need an explicit test)
  • openat
  • lseek

infiniteregrets avatar Jun 21 '22 02:06 infiniteregrets

So, then, the list of tests for this issue:

  • [x] open
  • [ ] fopen
  • [ ] fdopen
  • [x] openat
  • [x] read
  • [ ] fread
  • [ ] fileno
  • [x] lseek
  • [x] write

thedanvail avatar Jun 21 '22 04:06 thedanvail

@thedanvail it would be nice if we could just figure cases where python calls f family functions i.e. some real world scenarios and replicate them for the E2E. The tests implemented currently are for python only, would you be interested in working on tests for nodejs? Happy to help you in any possible way (:

infiniteregrets avatar Jun 21 '22 04:06 infiniteregrets

Also we should probably separate the tests for open into various scenarios, so that we know which case went wrong

infiniteregrets avatar Jun 21 '22 04:06 infiniteregrets

Sure, I can give that a shot - so I'll look at the f functions in Python and get some mock scenarios going. After that, I'll work on getting the node tests going, but for the sake of focus/PR size, I'll probably split the node-e2e tests into a separate PR from the python-e2e tests. If that sounds fair, I'll get crackin' - but I'll probably have some questions and, in which case, I'll communicate with y'all on Discord!

thedanvail avatar Jun 21 '22 14:06 thedanvail

Sounds great!

eyalb181 avatar Jun 21 '22 19:06 eyalb181

Just a quick update: This week has turned out to be very busy at work, but I've started to take a look just for context so far. Real work should begin tomorrow! Sorry for the delay!

thedanvail avatar Jun 22 '22 22:06 thedanvail

hi @thedanvail, just wanted to check in with you if you were able to get the tests to work.. please feel free to reach out in case you need any help! (:

infiniteregrets avatar Jun 30 '22 05:06 infiniteregrets

Hey Dan, I'm working on a refactor to the e2e, I'll probably do it in Python so writing e2e tests will be a bit easier (less concerns about safety & correctness there.)

aviramha avatar Jun 30 '22 08:06 aviramha

Sorry folks - this week has been very chaotic with some family issues and finishing up my final week at my job, so I've not been communicating as well as I could/should have. I'm working on it now, unless @aviramha you want to do it under the umbrella of work in your refactor? I can pick up a different issue if you do intend to cover this in your refactor.

thedanvail avatar Jun 30 '22 13:06 thedanvail

@thedanvail I hope all is well! I'm not planning to implement it, but just saying it might need to have a bit of changes to match the new design.

aviramha avatar Jun 30 '22 14:06 aviramha

@thedanvail I hope all is well! I'm not planning to implement it, but just saying it might need to have a bit of changes to match the new design.

Yeah, just needed to leave as the company and myself aren't quite aligned anymore and I wanted to finish projects before I left so that I didn't leave them up in the air.

Duly noted - I'll take that into account!

thedanvail avatar Jun 30 '22 15:06 thedanvail

PR added here

thedanvail avatar Jul 10 '22 04:07 thedanvail