Skip to content

Instantly share code, notes, and snippets.

cat /tmp/extended_descriptor.json | jq
{
"JobName": "test job",
"Tags": [
"test",
"csv"
@marcoguerri
marcoguerri / gist:2b7cda09613ab1103bf11fd675160e4c
Created March 5, 2021 10:54
Extended descriptor from start.json
MySQL [contest]> select extended_descriptor from jobs where job_id=3;
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@marcoguerri
marcoguerri / gist:d67bcdcfbb3a94928388a64d0ada6b89
Created March 5, 2021 10:52
start.json descriptor persisted in database
MySQL [contest]> select descriptor from jobs where job_id=3;
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
cat cmds/clients/contestcli/descriptors/start.json
{
"JobName": "test job",
"Runs": 1,
"RunInterval": "5s",
"Tags": ["test", "csv"],
"TestDescriptors": [
{
"TargetManagerName": "CSVFileTargetManager",
"TargetManagerAcquireParameters": {
[2020-06-15T12:39:36+02:00] INFO testfetchers/uri: Fetching tests with params {TestName:RackSwitchProvisioning URI:test_samples/randecho.json}
[2020-06-15T12:39:36+02:00] INFO pkg/jobmanager: Sending response &{Requestor:contestcli-http JobID:298 Err:<nil> Status:0xc00048f540}
[2020-06-15T12:39:36+02:00] INFO pkg/runner: Running job 'test job' 1 times
[2020-06-15T12:39:36+02:00] INFO pkg/runner: Run #1: fetching targets for test 'RackSwitchProvisioning'
[2020-06-15T12:39:36+02:00] INFO targetlocker/inmemory: Trying to lock 1 targets
[2020-06-15T12:39:36+02:00] DEBUG [github.com/sirupsen/logrus.(*Entry).Debugf][entry.go][323] targetlocker/inmemory: Requested to lock 1 targets: [Target{Name: "compute1234", ID: "172.16.5.6", FQDN: ""}]
[2020-06-15T12:39:36+02:00] INFO targetlocker/inmemory: Checking if 1 target(s) are locked by job ID 298
[2020-06-15T12:39:36+02:00] DEBUG [github.com/sirupsen/logrus.(*Entry).Debugf][entry.go][323] targetlocker/inmemory: Requested to check locks for 1 targets: [Target{Name:
[2020-06-15T12:39:51+02:00] INFO testfetchers/uri: Fetching tests with params {TestName:RackSwitchProvisioning URI:test_samples/randecho.json}
[2020-06-15T12:39:51+02:00] INFO pkg/jobmanager: Sending response &{Requestor:contestcli-http JobID:299 Err:<nil> Status:0xc000231040}
[2020-06-15T12:39:51+02:00] INFO pkg/runner: Running job 'test job' 1 times
[2020-06-15T12:39:51+02:00] INFO pkg/runner: Run #1: fetching targets for test 'RackSwitchProvisioning'
[2020-06-15T12:39:51+02:00] INFO targetlocker/inmemory: Trying to lock 1 targets
[2020-06-15T12:39:51+02:00] DEBUG [github.com/sirupsen/logrus.(*Entry).Debugf][entry.go][323] targetlocker/inmemory: Requested to lock 1 targets: [Target{Name: "compute1234", ID: "172.16.5.6", FQDN: ""}]
[2020-06-15T12:39:51+02:00] INFO targetlocker/inmemory: Checking if 1 target(s) are locked by job ID 299
[2020-06-15T12:39:51+02:00] DEBUG [github.com/sirupsen/logrus.(*Entry).Debugf][entry.go][323] targetlocker/inmemory: Requested to check locks for 1 targets: [Target{Name:
+----------+--------+--------+------------------------+------------------+-----------------+---------------------+-----------------+-------------------------------------+---------------------+
| event_id | job_id | run_id | test_name | test_step_label | event_name | target_name | target_id | payload | emit_time |
+----------+--------+--------+------------------------+------------------+-----------------+---------------------+-----------------+-------------------------------------+---------------------+
| 1 | 1 | 1 | RackSwitchProvisioning | thefirstrandecho | TargetIn | compute1234 | 172.16.5.6 | NULL | 2020-02-25 05:03:34 |
| 2 | 1 | 1 | RackSwitchProvisioning | thefirstrandecho | TargetFailed | compute1234 | 172.16.5.6 | NULL | 2020-02-25 05:03:34 |
| 3 | 1 | 1 | RackSwitchProvisioning | the
From 6d84ab0265133d565f963a274ae625fe9f5f600b Mon Sep 17 00:00:00 2001
From: Marco Guerri <marcoguerri@fb.com>
Date: Mon, 10 Feb 2020 15:59:07 +0000
Subject: [PATCH] Fixes
---
pkg/jobmanager/start.go | 18 ++++++++++--------
plugins/storage/rdbms/init.go | 8 ++++++--
plugins/storage/rdbms/report.go | 4 +++-
tests/integ/common/storage.go | 2 +-
Re-running as root with sudo
Step 1/3 : FROM mysql
---> b8fd9553f1f0
Step 2/3 : COPY docker/mysql/initdb.sql /docker-entrypoint-initdb.d/
---> Using cache
---> 44826aee1494
Step 3/3 : COPY docker/mysql/create_contest_db.sql /
---> Using cache
---> 4a2283588407
Successfully built 4a2283588407
{
"ServerID": "bbd45f7106a1",
"Type": "ResponseTypeStatus",
"Data": {
"Status": {
"EndTime": "2020-01-31T12:29:12Z",
"Name": "test job",
"Report": {
"JobID": 2,
"JobReport": {