Skip to content

Repository files navigation

Github Action (main)

Development

There are two sets of tests:

  • server: these run from inside the saver container
  • client: these run from outside the saver container, making api calls only
# Build the images
$ make {image_server|image_client}

# Run all tests
$ make {test_server|test_client}

# Run only tests whose id starts with Sp5
$ make {test_server|test_client} tid=Sp5

# Check test metrics
$ make {metrics_test_server|metrics_test_client}

# Check coverage metrics
$ make {metrics_coverage_server|metrics_coverage_client}

API

A cluster is the umbrella over a multi Language-Test-Framework (LTF) practice: it offers 2..5 LTFs, holding one ordinary Group per LTF (its children). A cluster is never joined directly; a joiner joins one of its child groups.

Verb Method Description
POST cluster_create Creates a cluster from the given manifest and returns its id.
GET cluster_manifest Gets the manifest of the cluster with the given id: its exercise and its children (one per Language-Test-Framework).
GET cluster_exists? Determines if a cluster with the given id exists.

A group is a shared practice for a single Language-Test-Framework: joiners join it, each allocated a distinct avatar (Lion, Salmon, Bee, etc) and their own Kata of the group's exercise. A group holds up to 64 katas, one per avatar. In a Cluster a group is one of the children (one per LTF).

Verb Method Description
POST group_create Creates a new group from the given manifest and returns its id.
GET group_manifest Gets the manifest used to create the group with the given id.
GET group_exists? Determines if a group with the given id exists.
POST group_join Creates a new kata in the group with the given id and returns the kata's id.
GET group_joined Returns the kata-id and kata-events-summary keyed against the kata's avatar-index (0-63) for the katas that have joined a group.
POST group_fork Creates a new group whose starting files are a copy of the files in the kata with the given id at the given index.

A kata is one participant's practice: created from a manifest (an exercise for a single Language-Test-Framework), it records every event as its own git commit - the create, each file create/delete/rename/edit, and each test run with its traffic-light colour (red, amber, green). Each avatar in a Group is a kata.

Verb Method Description
POST kata_create Creates a new kata from the given manifest and returns its id.
GET kata_manifest Gets the manifest used to create the kata exercise with the given id.
GET kata_exists? Determines if a kata exercise with the given id exists.
GET kata_events Gets the summary of all current events for the kata with the given id.
GET katas_events Gets the full details for the kata events with the given ids and indexes.
GET kata_event Gets the full details for the kata event whose kata has the given id whose event has the given index.
GET kata_download Returns a gzipped tar archive of the kata's git repository, base64-encoded.
POST kata_file_create Records a new empty file being created in the browser.
POST kata_file_delete Records a file being deleted in the browser.
POST kata_file_rename Records a file being renamed in the browser.
POST kata_file_edit Records a file edit event if any file content has changed since the last save.
POST kata_ran_tests Record a test event with no prediction.
POST kata_predicted_right Record a test event with a correct prediction.
POST kata_predicted_wrong Record a test event with an incorrect prediction.
POST kata_reverted Revert back to a previous traffic-light.
POST kata_checked_out Checkout a traffic-light from a different avatar.
GET kata_option_get Get a theme (dark/light) or colour (on/off) or prediction (on/off) option.
POST kata_option_set Set a theme (dark/light) or colour (on/off) or prediction (on/off) option.
POST kata_fork Creates a new kata whose starting files are a copy of the files in the kata with the given id at the given index.

Find the full Cluster/Group/Kata information of any id.

Verb Method Description
GET id_chain Returns the chain of ids from the given id up to its topmost containing entity, ordered bottom-to-top.

Compare a Kata's files between two event indexes.

Verb Method Description
GET diff_lines A diff of two sets of files (designated with was_index and now_index) from the kata with the given id.
GET diff_summary The same as diff_lines except the returned Hashes do not include the "lines" key.

Operational health checks, plus the git sha of the running image.

Verb Method Description
GET alive? Liveness probe - is the service alive?
GET ready? Readiness probe - is the service ready to handle requests?
GET sha The git commit sha used to create the Docker image.

Screenshots

cyber-dojo.org home page

About

repo for the cyberdojo/saver Docker image microservice

Topics

Resources

Contributing

Stars

3 stars

Watchers

4 watching

Forks

Contributors

Languages