Setting up the work environment - amauran/project-giskard GitHub Wiki

2023-03-07

Additional installations and setup

The test server

  • added a firewall to the happy-robot test server
    • set the inbound rule to only accept specific IP access
    • to remember: protocol TCP, port 22 is SSH, port 80 is HTTP, port 443 is HTTPS
      (TCP and UDP port numbers)

VSCode and Git

  • set the home directory of the user (/home/anne) as a trusted folder in Visual Studio Code

    • Workspaces: Manage Workspace Trust
    • at the bottom of the window you can edit trusted folders

    trusted-folders-small

    ^ over here (once you actually find this window :D)

  • created a folder named 'Git' for the user in the home directory

    • brought in old projects first, just unzipped into 'Git'
  • created a .ssh folder in the user home directory for ssh keys

    • created ssh keys to use with project
      (for cloning the project and getting access to the project server)
    • removed some usage permissions from the private key with
      chmod og-r <filename> (remove the read permission for all users except the file’s owner)
      (chmod command in linux)
  • installed Git version control system into Ubuntu

    • note: this has to be done separately to make it work outside of VSCode too
    • note for glossary:
      Git is a version control system that lets you manage and keep track of your source code history.
      GitHub is a cloud-based hosting service that lets you manage Git repositories
  • cloned this project to VScode (project-giskard)

Poetry, virtual environment, and Robot Framework

  • installed Poetry for user 'anne'
    • Poetry requires Python 3.7+
    • installation instructions: https://python-poetry.org/docs/
    • initialized Poetry for project-giskard
      • open Terminal, the Ubuntu window (which I learned is actually 'bash' ;D)
      • enter command poetry init
    • made it so that the virtual environment created by Poetry will be inside the project
      • go to root of the project folder

      • create poetry.toml file if it does not exist (I think we did this in VSCode...)

      • add the following to the file and save:

        [virtualenvs]
        in-project = true
        

*NOTE: Always open a Poetry shell when installing/changing/etc. stuff WITHIN the virtual environment

  • Installed Robot Framework in a virtual environment within the project folder, using Poetry

    • open Terminal (bash) inside the project folder (~/Git/project-giskard)
    • activate the virtual environment with poetry shell command
    • now the location should be virtual, indicated by the project name and python version in parenthesis before the actual location
      like this: (project-giskard-py3.10) anne@Miyuki:~/Git/project-giskard$
    • now use command poetry add robotframework and it should install inside the virtual environment
      • note: use poetry add instead of apt install or similar, while within Poetry-created venv
    • now Robot Framework should be installed with all the dependencies required
  • Note: there is also a project specific version of Python within the virtual environment

    • any changes to that must be done within the active venv, like installing a new version etc.

nvm, npm, Node

  • Installed Node Version Manager in the user home directory

    • there are commands for getting and running the installer, but I think we took the command out of that and just ran it in a bash window
      (clearly this was not properly documented at the time ;D)
    • npm gets installed along with Node
  • Installed a Long-Term Support version of Node with nvm

    • nvm install --lts
    • note: add LTS to glossary

Selenium vs. Playwright

  • Installed Playwright and BrowserLibrary to test them

  • Installed Selenium and SeleniumLibrary

    • both were installed within the virtual environment in the project

      • open Terminal (bash) in project folder
      • activate venv with poetry shell
      • poetry add selenium
      • poetry add robotframework-seleniumlibrary (that is actually the package name for this)
    • installed Chromedriver for Chrome/Chromium web support

Chrome for Ubuntu

  • installed Chrome in Ubuntu for all users (after a few fixes mentioned below)

    • this was needed so the robot tests can use Chrome on the Ubuntu side, since they can't easily access the one in Windows
  • added Google repository into Ubuntu (because there was an apt-key issue)

    • added the appropriate apt-key

    • told Ubuntu to use that key for the Google repository

    • ran sudo apt update to get Ubuntu to recognize the changes

    • ran sudo apt upgrade to implement changes

    • to be added: these still need proper documentation on how we did it, as it took several steps

Made a pic on where all things should now be located

2023-03-04

Starting status

  • an older MSi laptop with Windows 10, with both NVIDIA and Intel graphics cards
  • Visual Studio Code had already been installed, with some version of WSL, and Robot Framework plugin
  • Python was installed both on the Windows side as well as the Linux side on WSL
  • Windows Terminal already installed (Powershell, Ubuntu)

Clean up

  • Uninstalled Ubuntu from Windows before removing WSL

    • go to Start Menu, Settings, Apps & Features
    • click on app
    • choose uninstall
  • Removed WSL feature (for cleaner setup and to learn how to install it later)

    • go to Start Menu, Settings, Apps & Features
    • sidebar on the right, choose Programs and Features
    • that takes you to Control Panel\Programs\Programs and Features
    • on the left choose 'Turn Windows features on or off'
    • that opens a new window with checkboxes
    • find 'Windows Subsystem for Linux', uncheck the box, and click save

Updates and installations

  • Updated the BIOS to a slightly newer version

  • Updated Intel Firmware

  • Updated Dragon Center (MSi's own control panel)

  • Installed Intel Driver & Support Assistant

    • updated any Intel drivers possible
  • Updated the NVIDIA driver (Game Ready version) through GeForce Experience

  • NOTE: later we checked that both the Intel and NVIDIA drivers should support WSL innately

  • Updated Windows -_-

  • Re-installed WSL

    • open Terminal, open a Powershell window as admin
    • enter command wsl --install (only works if WSL is not installed at all)
      • this will install WSL, which will then by default install Ubuntu
      • To change the distribution installed use command wsl --install -d <Distribution Name>
  • Updated Ubuntu

    • open Terminal, open Ubuntu window
    • enter command sudo apt update (this will find info on available updates)
    • enter command sudo apt upgrade (this will actually install the updates)
    • this can also be done with sudo apt update && sudo apt upgrade -y (performs both, but only performs upgrade if update succeeds)

Checks

  • Installed and ran 'xeyes' for Ubuntu to check that graphics really work with WSL on this setup
    • open Terminal, open Ubuntu window
    • enter command apt-get install x11-apps
    • enter command xeyes to run the program
    • It worked!!! ^_^
⚠️ **GitHub.com Fallback** ⚠️