Skip to content

Latest commit

 

History

History
94 lines (77 loc) · 3.07 KB

CONTRIBUTING.md

File metadata and controls

94 lines (77 loc) · 3.07 KB

Contributing to Qlik-Cli

Development tools and modules

Required

  • Windows PowerShell 4+ or PowerShell Core
  • Git - for cloning and pushing changes

Recommended

  • Pester - PS module for running unit tests
  • PSScriptAnalyzer - PS module to check code formatting
  • PlatyPS - PS module to update documentation
  • Psake - PS module for build automation
  • Text editor or IDE that supports EditorConfig (e.g. Visual Studio Code)

Additional

  • VirtualBox - Virtualisation platform used by Vagrant and Test Kitchen
  • Vagrant - Used to automate the build of VMs used for integration testing
  • Test Kitchen - Used to automate the integration testing process

Get the code

  1. Fork it ( https://github.com/ahaydon/Qlik-Cli-Windows/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Code structure

  • docs - markdown documentation generated by PlatyPS
  • functions - scripts containing internal functions
  • resources - scripts containing exported commands
  • tests - Pester test scripts

Pull request checks

Before making a pull request you should check that your code changes will pass the automated checks, this will help to prevent you request being rejected.

  1. Run unit tests
Invoke-Pester
  1. Check your code conforms to best practices
Invoke-ScriptAnalyzer -Path . -Recurse -ReportSummary
  1. Check your code meets the code formatting standards of this repo
Invoke-ScriptAnalyzer -Path . -Recurse -ReportSummary -Settings CodeFormatting -ExcludeRule PSAlignAssignmentStatement
  1. Ensure documentation is up to date, if you have Psake installed you can run Invoke-Psake UpdateDocs, otherwise run the following:
Remove-Module Qlik-Cli; Import-Module ./Qlik-Cli.psd1 -Force
Update-MarkdownHelpModule -Path ./docs -RefreshModulePage -ModulePagePath ./docs/index.md -UpdateInputOutput -Force
  1. Update the markdown help files by adding descriptions and examples for any cmdlet that you have added or changed

CircleCI Local CLI

A Vagrantfile is provided that will build a machine running Docker and CircleCI CLI, this machine can be used to test CI configs.

vagrant up
vagrant ssh
cd /vagrant
circleci local execute --job test-unit
circleci local execute --job quality-check

Test Kitchen

To override the box used for a platform add the following to a file called kitchen.local.yml and set the box you want to use.

platforms:
  - name: windows-2019
    driver:
      box: my/windows-2019

To prevent the need to download Qlik Sense every time the instances are rebuilt you can mount the cache folder to the host machine. Adding the following code to the Kitchen config ($HOME/.kitchen/config.yml) will mount the cache directory on all instances.

driver:
  name: vagrant
  synced_folders:
    - ["<%= ENV['HOME'] %>/.kitchen/cache", "C:\kitchen-cache"]
kitchen create
kitchen converge
kitchen verify
kitchen destroy