[Sugar-devel] Summary of 17.08 meeting with mentors

James Cameron quozl at laptop.org
Sat Aug 19 16:13:20 EDT 2023


On Sat, Aug 19, 2023 at 10:04:22PM +0300, Dimitris20Cen wrote:
> SSH Connection for Testing
> - Ibiam suggested setting up an SSH connection between the host and
> the VM (using rsync or scp) to streamline the process of testing
> activities.

I agree.  Aim to reduce the time between editor save and activity test
to under a second.  Saving time can be easily justified once you
measure how many iterations you consume.  Developing from inside Sugar
is very unusual.

Some methods that I use;

1.  a keyed access via SSH, so no password prompts,

2.  run screen(1) inside Terminal, so commands can be typed on either
the target system or my development system,

3.  write a shell script that transmits the activity directory once,
then uses inotifywait -e close_write to detect when editor save
happens, so that transmit happens automatically,

4.  or use an editor with file access over SSH feature,

5.  or use a filesystem sharing such as sshfs, or nfs,

6.  add a temporary restarter to the activity class, triggered by
editor macro and the transmit script above, for example from my
fedora18 branch of the Record activity,

        # testing restarter
        def restarter():
            if os.stat('go').st_ctime != ct:
                self.close()
                os.execv('/usr/bin/sugar-activity3', ['sugar-activity3'])
                logger.error('== restarted ==')
                return False
            return True
        try:
            ct = os.stat('go').st_ctime
            glib.timeout_add(233, restarter)
        except:
            pass

(this works by recording the creation time of a marker file, then
watching for a change to the time, then restarting the activity.)

7.  use xdotool to send keystrokes and mouse actions to the activity,
to bring it to the test case being developed for,

8.  use IDE or editor "compile" command to copy files and remote start
the activity.


More information about the Sugar-devel mailing list