Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Elliria/f26fab7fadb9c2195100f9a8bc42b498 to your computer and use it in GitHub Desktop.
Save Elliria/f26fab7fadb9c2195100f9a8bc42b498 to your computer and use it in GitHub Desktop.
AutoKey run tests and provide feedback on a pull request

AutoKey run tests and provide feedback on a pull request

🛑 Caution: Although the steps below have you creating and using a clone of AutoKey, the clone shares the same configuration folder as the installed copy of AutoKey. Since there's always a risk of corruption of files when one is testing new code, it's best not to run these tests on a system where the installed copy of AutoKey contains valued custom phrases and/or scripts. I recommend creating a virtual machine instead.

  1. Make sure that the system you'll be doing the tests on already has a working copy of AutoKey installed on it (so that you'll already have all the necessary apt dependencies).

  2. Install the git package in Kubuntu.

  3. Install the tox package in Kubuntu.

  4. Open the directory you'd like to create the cloned autokey directory inside of in a terminal window.

  5. Clone the PR:

    git clone https://github.com/autokey/autokey.git
    cd autokey
    git fetch origin pull/1004/head:pull_1004
    git checkout pull_1004
    python3 -m venv venv
    source venv/bin/activate
    pip install -r pip-requirements.txt
    pip install packaging
    
  6. Run the control tests:

    1. Make sure you're in the cloned autokey directory.
    2. Pick one:
      • Run the AutoKey GTK toolkit:
        source venv/bin/activate && cd lib && python3 -m autokey.gtkui -cl
        
      • Run the AutoKey Qt toolkit:
        source venv/bin/activate && cd lib && python3 -m autokey.qtui -cl
        
    3. Immediately shut AutoKey down.
    4. Copy everything from the terminal window and save it as control-gtk.log or control-qt.log, depending on which toolkit you ran.
  7. Run the performance tests on both toolkits:

    1. Make sure you're in the cloned autokey directory.
    2. Pick one:
      • Run the AutoKey GTK toolkit:
        source venv/bin/activate && cd lib && python3 -m autokey.gtkui -cl
        
      • Run the AutoKey Qt toolkit:
        source venv/bin/activate && cd lib && python3 -m autokey.qtui -cl
        
    3. Use all of the default phrases and scripts, making notes of your observations for each.
    4. Shut AutoKey down.
    5. Copy everything from the terminal window and save it as performance-gtk.log or performance-qt.log, depending on which toolkit you ran.
  8. Run the tox test:

    1. Make sure you're in the cloned autokey directory.
    2. Run the tox command.
    3. Copy its output and save it as tox.log.
  9. Clean up AutoKey after using tox:

    • Whenever the tox command is run, it causes AutoKey to create duplicates of its phrase and script folders. These are not always easy to delete. The most reliable way of doing so is to shut down AutoKey, delete the ~/.config/autokey/data directory, and restart the cloned copy of AutoKey.
    • Note that the clone's phrases and scripts are configured to use Ctrl+v for pasting. This may not work properly in certain operating systems. If you normally use AutoKey 0.95.10 and you start doing the performance tests and get <ctrl as the output for phrases instead of the expected text, either manually configure each phrase and script to use the keyboard before doing the tests or delete the ~/.config/autokey/data directory, and restart the installed copy of AutoKey and shut it down before repeating the tests. This will ensure that the phrases and scripts are configured to use the keyboard for pasting.
  10. Once you've done the tox and control tests and have done the performance tests with both toolkits, post all of your notes and logs in a PR comment.

  11. If you're feeling frisky and would like to do some further testing, you can come back to the existing clone later and launch it again as many times as you like with either of these:

    • Run the AutoKey GTK toolkit:
      source venv/bin/activate && cd lib && python3 -m autokey.gtkui -cl
      
    • Run the AutoKey Qt toolkit:
      source venv/bin/activate && cd lib && python3 -m autokey.qtui -cl
      
  12. When you're finished testing the clone and no longer need it, you can delete the cloned autokey directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment