[GSoC 2017] Community Bonding

Clemens Lang cal at macports.org
Mon May 22 21:18:45 UTC 2017


Hi,

On Tue, May 23, 2017 at 12:52:55AM +0530, Umesh Singla wrote:
> I have written two introductory posts on my blog [0] on Blogger. I
> thought I shared the link to it in the proposal but no, I didn't. The
> one is just when the results got announced and other about my take on
> the macports-base video.

Let me know if you have any questions about the codebase that you'd like
to see answered.


> About the project, so the `restore`, `snapshot` and `migrate` actions
> are going to the action_array list [1]. While the flow was made clear
> in the proposal, I think the first step should be to decide on an
> exhaustive list of arguments/flags these 3 actions can possibly take.
> This will help to design the procedures.
> 
> Also, should we keep the code in a different Tcl script migrate.tcl
> like `reclaim`?

I would prefer that, yes. You'll just need
  package provides macports 1.0
line at the top and then you can write code as if it was in
macports.tcl. Alternatively, you can do what reclaim.tcl does and use
  package provides migrate 1.0
and add 'package require migrate 1.0' in macports.tcl.

> and code dealing with the database is going to be in C in cregistry's
> sql.c [2], right? (like Tcl calling registry2.0 code currently?)

If you need any additional special SQL queries, that can be done, yes.
There should be abstractions available in Tcl already so that you don't
have to deal with SQLite's C API directly, though.


> All this is still trivial. What worries me most is the testing part.
> I'm not sure Brad, how are we going to take on the testing phase. We
> can virtually change specifications to see if the script works or
> compare the two docker images? Also, it needs a set of tests that
> should include all combinations of variants,
> requested-activate-deactivate scenarios. This is one big task to be
> considered.

Yes, the testing is not trivial at all. It might make sense to work with
mocking a lot here (e.g. overwrite functions that would usually be
called by your code to do nothing). That would allow you to run tests
without actually changing your system or doing a lot of environment
setup.

Fortunately Tcl makes this quite easy because you can change any
function definition at runtime. See [1] and [2] where I used this
technique to make the test think it runs as root or runs on a machine
with a different number of processors.


> Guide me to the first step, thanks. It'd be great if you want to have
> a FaceTime or Skype. I think after 0900 (UTC -8) would suit you best?

Let me know if you have any questions after that. I'm always happy to
help!


[1] https://github.com/macports/macports-base/blob/master/src/port1.0/tests/portactivate.test#L29-L48
[2] https://github.com/macports/macports-base/blob/master/src/port1.0/tests/portbuild.test#L26-L46

-- 
Clemens


More information about the macports-dev mailing list