Git Product home page Git Product logo

ironbird's Introduction

ironbird

An Iron Bird

An iron bird is a ground-based test device used for prototyping and integrating aircraft systems during the development of new aircraft designs.

Integration-tests Concourse tasks using fly execute, using a YAML test definition format.

Installation

brew install engineerbetter/tap/ironbird

Usage

$ ironbird --specs some_spec.yml,some_other_spec.yml --target eb [--timeout-factor <int>]
  • --specs - comma-separated list of spec files (see below)
  • --target - fly target on which to execute the tests, and for which there is already a valid auth token
  • --timeout-factor multiplies the default or provided timeouts for execution. Useful if your Concourse is slower than that of the person who wrote the spec.

Why?

Concourse tasks should be tested, and there was no simple, succinct way to test simple tasks. No-one wants to write a hundred lines of Golang to test four lines of Bash.

Spec Format

See *_spec.yml files in integration for examples.

---
# Task config file (required)
config: existing_file_write.yml
# details of input that task config is normally within (optional)
enclosed_in_input:
  # the name of the input containing the task.yml (optional)
  name: some-repo
  # where the 'root' of the input containing task YAML/script is, relative to this spec file (optional)
  path_relative_to_spec: ../../../
cases:
# Each 'when' maps to a `fly execute` invocation
- when: modifier is specified
  # timeout for fly execute (optional, defaults to 20s)
  within: 1m30s
  it:
    # Expected exit code of fly execute (optional, defaults to 0)
    exits: 0
    # Ordered list of things to expect on STDOUT (optional)
    says: [something printed to STDOUT]
    # Define outputs to pull down (optional)
    has_outputs:
      - name: output
        for_which:
          # The following bash will be executed and asserted against
          - { bash: "stat existing", exits: 0, says: "4096 0 0 existing" }
          - { bash: "stat modified", exits: 0 }
    # Additional inputs needed for this test (optional)
    has_inputs:
      - name: input
        # Dir, relative to this spec file, to use as the basis for the input (optional)
        from: fixtures/existing_file
        # Bash commands to apply to either blank dir, or dir above, before running fly execute (optional)
        setup: |
          echo foo > modified
  # Param values provided to the task (optional)
  params:
    CONTENTS: mycontents
    FILENAME: myfile

โš ๏ธ๐Ÿ”ฅ Setup/Bash steps are not containerised

The setup and bash scripts for inputs and outputs respectively do not run in a container and execute on the machine that ironbird was executed on, rather than in the fly executed container. Do not execute anything destructive, or that changes global config.

Wouldn't it be quicker if the tests ran in Docker?

Yes.

Contributing

https://ci.engineerbetter.com/teams/main/pipelines/ironbird

Build status

Testing

The canonical reference for how to run the integration tests is the CI pipeline, but a (possibly out-of-date) copy is presented here for convenience:

# Get dependencies
go get github.com/onsi/ginkgo/ginkgo
go get github.com/onsi/gomega
# Login to a Concourse upon which to run the tests
fly login -t this -c ${concourse_url} -u ${concourse_username} -p ${concourse_password}
fly -t this sync
# Run the tests
cd integration
ginkgo -p -- --target this

ironbird's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

apkulick

ironbird's Issues

Allow YAML params and serialize them to JSON

When using a task in Concourse, params can be provided as YAML objects and Concourse will just serialize the object as JSON and that is the value of the env var. Trying to write Ironbird tests that use YAML values as params fails as params is expected to be map[string]string. It would be good if it matched the behaviour of Concourse - i.e. params is map[string]interface{} which is then serialized

Allow easier intercepting of failures

fly executed containers can be intercepted. On failure, Ironbird should make this easier to do by surfacing the build number or even the intercept command.

Docker backend

It'd be nice for local feedback to use Docker as a backend instead of fly execute, as I suspect this would be way faster. Downside of this is needing to understand and maintain parity with what Concourse does when it sets up a task, so could become a maintenance burden.

does_not_say

Would be nice to be able to test in the negative, with an array of does_not_say. Would need to think about whether ordering is important.

--focus

Could do with a --focus flag to allow users to run only one case. Identifying them would probably require entering the entire string though, or maybe a regex? Doubt we could do line numbers because of the way we're parsing YAML

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.