Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Sync test data between local dev envs and CI via bob-server #110

Open
dketterer opened this issue Jun 20, 2022 · 0 comments · May be fixed by #137
Open

Feature: Sync test data between local dev envs and CI via bob-server #110

dketterer opened this issue Jun 20, 2022 · 0 comments · May be fixed by #137
Labels
enhancement New feature or request

Comments

@dketterer
Copy link
Contributor

dketterer commented Jun 20, 2022

Introduce a new feature that handles test data in bob.

Test data is a team-shared storage which provides files needed to run tests. It is not git-lfs, files are versioned but it is easier to handle with less overhead. Eg. you can easily jump between test data versions without affecting the rest of your code base.

How to add files: bob.yaml: specifies directories which are testdata, each with a version tag. Eg:

version: 0.0.2
project: localhost:8100/benchkram/bob-server
use-nix: true
nixpkgs: https://github.com/NixOS/nixpkgs/....

import:
  - docgen
  - ui

variables:
  ...

sync:
  videos:
    path: ./videos
    version: big-feature
  invoice_test_data:
    path: ./tests/invoice_samples
    version: 0.0.1

run:
....

Test data must not collide with git, all files have to be mutually exclusive.

Bob remembers a mapping: local test data path -> file hash to speed up synchronization.

Access-control: not all users (api-tokens) in a project are allowed to push. 'read' and 'read/write' will be the two authorization levels to prevent some users from changing the test data on the server.

Future development:

  • Test data can be locally encrypted before uploaded. However, the key can be shared via bob.
  • Sync before task: Sync is automatically called everytime "bob build" is called and inputs are within the testdata folder (one has to make sure all test data accessed from code is referenced correctly)

Potential CLI:

daniel@beutelsend my_project ➜ bob testdata --help
Sync (binary) test data via a bob-server.

Usage:
  bob testdata [flags]
  bob testdata [command]

Available Commands:
  ls          list files synced by testdata
  ls-remote   list files on server
  push        make server exactly like local
  pull        make local folder exactly like server


Flags:
  -h, --help       help for build

Global Flags:
  -v, --verbosity int   set verbosity level (default 1)

Use "bob testdata [command] --help" for more information about a command.

Possible work activity:

  • have some folder with data

  • introduce bob

  • add the folder as collection to the bob file, do not define a version tag

  • push to remote

  • pull on some other machine

  • change the data in the folder

  • accidentally hit push

  • get asked if you want to apply changes to the server

  • press no

  • go to bob file and add a new version tag

  • run bob push

  • bob creates a new collection, nothing is lost, bob does not have to prompt

  • you are looking for a specific version of a file

  • you head to bob-server

  • select the path

  • you see all the version tags which include this file

@dketterer dketterer added the enhancement New feature or request label Jun 20, 2022
@dketterer dketterer linked a pull request Jul 20, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant