GithubHelp home page GithubHelp logo

mbrukman / bt-fixture Goto Github PK

View Code? Open in Web Editor NEW

This project forked from takashabe/bt-fixture

0.0 2.0 0.0 19 KB

bt-fixture is a test-fixture management library for the cloud bigtable.

License: MIT License

Makefile 7.11% Go 92.89%

bt-fixture's Introduction

bt-fixture

bt-fixture is a test-fixture management library for the Cloud Bigtable.

GoDoc CircleCI Go Report Card

Management the fixtures of the database for testing.

Features

  • Load the Cloud Bigtable columns fixture by a yaml file
  • Before cleanup a table
  • Types
    • int and float types in a fixture convert to big-endian 8-byte values

Usage

  • Import bt-fixture package and setup a fixture file
package main

import (
  fixture "github.com/takashabe/bt-fixture"
)

func main() {
  // omit the error handling
  f, _ := fixture.NewFixture("test-project", "test-instance")
  f.Load("testdata/fixture.yaml")
}

Fixture file format

table: person
column_families:
  - family: d
    columns:
      - key: 1##a
        rows:
          name: a
          age: 10
          height: 140.0
        version: 2018-05-19 00:00:00 +00:00
      - key: 1##a
        rows:
          name: a
          abe: 11
          height: 140.0
        version: 2019-05-19 00:00:00 +00:00
  - family: e
    columns:
      - key: 2##b
        rows:
          name: b
          age: 20
          height: 180.0
        version: 2018-05-19 00:00:00 +00:00
  • Example output:
$cbt read person
----------------------------------------
1##a
  d:age                                    @ 2019/05/19-00:00:00.000000
    "\x00\x00\x00\x00\x00\x00\x00\v"
  d:age                                    @ 2018/05/19-00:00:00.000000
    "\x00\x00\x00\x00\x00\x00\x00\n"
  d:height                                 @ 2019/05/19-00:00:00.000000
    "@a\x80\x00\x00\x00\x00\x00"
  d:height                                 @ 2018/05/19-00:00:00.000000
    "@a\x80\x00\x00\x00\x00\x00"
  d:name                                   @ 2019/05/19-00:00:00.000000
    "a"
  d:name                                   @ 2018/05/19-00:00:00.000000
    "a"
----------------------------------------
2##b
  e:age                                    @ 2018/05/19-00:00:00.000000
    "\x00\x00\x00\x00\x00\x00\x00\x14"
  e:height                                 @ 2018/05/19-00:00:00.000000
    "@f\x80\x00\x00\x00\x00\x00"
  e:name                                   @ 2018/05/19-00:00:00.000000
    "b"

bt-fixture's People

Contributors

takashabe avatar

Watchers

 avatar  avatar

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.