Skip to content

Latest commit

 

History

History
154 lines (119 loc) · 5.55 KB

40-code-overview.md

File metadata and controls

154 lines (119 loc) · 5.55 KB

Code Overview

Note:

  • Agenda:
    • main blocks
    • main folders
    • workflows: Java & Web
    • Writing tests

Main Blocks

Main Folders

  • java: bulk of the code
  • web/html/src: JS-based UI code
  • schema/spacewalk/common: database definition
  • schema/spacewalk/upgrade: database upgrade scripts
  • testsuite: cucumber tests
  • susemanager-utils/susemanager-sls: custom Salt states
  • susemanager-utils/testing: tools for automated tests

Java Pointers

Salt events listener: com.suse.manager.reactor.SaltReactor

Java Workflow

  • Hack

  • Deploy on dev instance

    • In java/buildconf/manager-developer-build.properties edit deploy.host
ant -f manager-build.xml refresh-branding-jar \
    deploy restart-tomcat restart-taskomatic
  • Prepare packages

  • Deploy sumaform test instance

  • Write cucumber tests

  • Add entry in java/spacewalk-java.changes

Web Workflow

  • Start dev instance
cd uyuni/web/html/src
yarn proxy --server https://dev-srv.tf.local
  • Hack

  • See changes live

  • Add entry in web/spacewalk-web.changes

https://github.com/uyuni-project/uyuni/wiki/Frontend-Development-Environment

Writing Tests

  • Feature / Scenario / Steps
    • English only
    • Code in testsuite/features/step_definitions
  • Existing steps in testsuite/documentation/cucumber-steps.md
  • New idempotent features in testsuite/features/secondary

Test Example

@virthost_kvm
  Scenario: Resume a KVM virtual machine
    Given I am on the "Virtualization" page of this "kvm-server"
    When I wait until table row for "test-vm" contains button "Resume"
    And I click on "Resume" in row "test-vm"
    Then I should see "test-vm" virtual machine running on "kvm-server"
Then(/^I should see "([^"]*)" virtual machine (shut off|running|paused)
      on "([^"]*)"$/x) do |vm, state, host|
  node = get_target(host)
  repeat_until_timeout(message: "#{vm} virtual machine on #{host} "\
                                "never reached state #{state}") do
    output, _code = node.run("virsh domstate #{vm}")
    break if output.strip == state
    sleep 3
  end
end