profile
viewpoint

startedderailed/k9s

started time in 4 days

startedmehrdadrad/radvpn

started time in 4 days

startedegonelbre/gophers

started time in 4 days

startedskatiyar/pacman

started time in 4 days

pull request commentcyber-dojo-languages/go

Use alpine for smaller image, update go version to 1.13.4

Hi Jon,

Amazing, thanks for the quick turn around. We met at Bedruthan, a few weeks ago.

miketonks

comment created time in 11 days

push eventhf-dojo/go

JonJagger

commit sha a79809a7965d237fbd9c8fa26ddbdcd853f8745d

image is now based on Alpine

view details

JonJagger

commit sha cc41a6d5d39886bffee9ac31d204b8c8195e0f3c

Switch from Travis to CircleCI

view details

JonJagger

commit sha efb733dd2904ea1bf41ea4591747bfed26589b2e

[ci skip] Delete dead file

view details

miketonks

commit sha 0cd762376e96b1bb1af4d3e6f799c7ea96afb0f5

Merge branch 'master' into master

view details

push time in 11 days

push eventmiketonks/swag

Mike Tonks

commit sha a2be7ef9aacdf64c91b700e1dfcf919a240e6b34

Fix failing test - not sure about this but code has default value, so test should expect it

view details

push time in 12 days

push eventmiketonks/swag

Mike Tonks

commit sha 06d960e54947cf8b3ebbc62411732729837277d1

Updated travis config

view details

push time in 12 days

push eventhf-dojo/go

Mike Tonks

commit sha 5cdeef77f444884e56f99e02db2270d86b96ece6

Switch to CircleCI

view details

push time in 12 days

issue commentsmartystreets/goconvey

panics upon test failure

Could be duplicate of https://github.com/smartystreets/goconvey/issues/566

It's not a panic, just printing out stack trace on failure. Probably this should be optional, and default to off.

harkamals

comment created time in 13 days

pull request commentcyber-dojo-languages/go

Use alpine for smaller image, update go version to 1.13.4

Looks like I did something wrong, as Travis fails. Looks like it's running the old code, not my updated version. Or perhaps failed to build locally.

Meanwhile I've created two new repos for new languages:

  • https://github.com/hf-dojo/go-convey

  • https://github.com/hf-dojo/go-testify

using golang base with two different test frameworks. Not sure how to do a PR for those as it needs new languages repos to be created on github first?

miketonks

comment created time in 13 days

push eventhf-dojo/go

Mike Tonks

commit sha 31457d4291f3e860b309b9b689050cdbebf98e48

Add git to base image (required for go get)

view details

push time in 13 days

create barnchhf-dojo/go-testify

branch : master

created branch time in 13 days

create barnchhf-dojo/go-convey

branch : master

created branch time in 13 days

created repositoryhf-dojo/go-convey

Docker image for Go, convey test framework on cyber-dojo https://cyber-dojo.org

created time in 13 days

created repositoryhf-dojo/go-testify

Docker image for Go, testify test framework on cyber-dojo https://cyber-dojo.org

created time in 13 days

PR opened cyber-dojo-languages/go

Use alpine for smaller image, update go version to 1.13.4

Make image smaller, using alpine base Update to latest go version

Borrowing heavily from https://github.com/docker-library/golang/blob/f30f0428221b94c7dcb414ebdcea83106df20897/1.13/alpine3.10/Dockerfile

+26 -4

0 comment

2 changed files

pr created time in 13 days

push eventhf-dojo/go

Mike Tonks

commit sha 869fed4e36409a57bbe0007528a47fd4de91918a

Use alpine for smaller image, update go version to 1.13.4

view details

push time in 13 days

fork miketonks/go

Base docker-image for Go test-frameworks on

http://cyber-dojo.org

fork in 13 days

push eventmiketonks/goconvey

Mike Tonks

commit sha 0950975264d1dbc1919736717833c160f44aeff3

Add StackMode to make stack traces configurable

view details

push time in 13 days

PR opened smartystreets/goconvey

Add StackMode to make stack traces configurable

Adds StackMode as an optional parameter to Convey, in the same way that FailureMode is implemented.

StackMode can be Error (default - print stack only on errors) or Fail (print stack for failure and errors).

Fixes: Make stacktrace on error optional #566

+223 -11

0 comment

11 changed files

pr created time in 13 days

push eventmiketonks/goconvey

Mike Tonks

commit sha 238c6ef2bfb00331b80a375344e164a8585178a8

Add StackMode to make stack traces configurable

view details

push time in 13 days

create barnchmiketonks/goconvey

branch : stack-mode

created branch time in 13 days

fork miketonks/goconvey

Go testing in the browser. Integrates with `go test`. Write behavioral tests in Go.

http://goconvey.co

fork in 13 days

issue commentsmartystreets/goconvey

Add support for TestTables (ConveyMany)

Thanks for the feedback.

I think there are a lot of different and diverse opinions and approaches to testing. I hope this idea could be a useful addition to the options available.

Here's what I think it could look like.

There are two patterns supported. First, when TestTable is just a simple slice, and the test function takes a single parameter:

func TestIsPrime(t *testing.T) {

	Convey("When IsPrime is called", t, func() {

		Convey("When the number is a prime number, the result should be true",

			TestTable(2, 3, 5, 7, 11, 13, 17, 19),

			func(n int) {
				So(IsPrime(n), ShouldBeTrue)
			})

		Convey("When the number is not a prime number, the result should be false",

			TestTable(1, 4, 6, 8, 9, 10, 12),

			func(n int) {
				So(IsPrime(n), ShouldBeFalse)
			})
	})
}

Second, the TestTable can also contain a list of TestValues, which contain multiple values. Here the test function has muultiple parameters (which must match the test values):

func TestSum(t *testing.T) {

	Convey("When two integers are added together", t,
		TestTable(
			TestValues(1, 1, 2),
			TestValues(1, 2, 3),
			TestValues(5, 6, 11),
			TestValues(1, 3, 4),
		),
		func(a, b, c int) {
			ans := Sum(a, b)
			So(ans, ShouldEqual, c)
		})
}

There's are fully worked examples in the repo I posted earlier, and the tests all pass. Of course these are just mickey-mouse examples but I hope you'll agree that the code is fairly readable.

Having looked at the convey code, I think the ...interface{} approach should allow this to be added fairly easily. The wrapper approach might also work, but may end up with lots of duplication from the convey codebase.

Any input appreciated.

miketonks

comment created time in 19 days

push eventntt-nflex/pyvmomi

Mike Tonks

commit sha e31ba7468a4396c8b08b29931558c64366cee3b4

Added missing params to SmartConnect

view details

push time in 19 days

push eventntt-nflex/pyvmomi

push time in 19 days

push eventmiketonks/swag-validator

Mike Tonks

commit sha 15cf14be25288b5d9c4848abf61340ef94777a53

Add GodDoc badge to README

view details

push time in 20 days

push eventmiketonks/swag-validator

Mike Tonks

commit sha 58a4def8c9301407945e378c0b7139bd4aa1aded

Add GodDoc badge to README

view details

push time in 20 days

push eventmiketonks/swag-validator

Mike Tonks

commit sha 117950669f4ff47898315557fe00cf02ba87b3a6

Add travis build status to README

view details

push time in 20 days

push eventmiketonks/swag-validator

Mike Tonks

commit sha bfa072202d39eb6beded7531b16d8f185641a03f

Fix failing tests

view details

push time in 20 days

push eventmiketonks/swag

Mike Tonks

commit sha d5fe472295374e8e89be93d24258f91389019056

Fix incorrect pattern for Date and Time

view details

push time in 20 days

push eventmiketonks/swag-validator

Mike Tonks

commit sha 7b46650c0e7fbec36a647dc1ed31a70dc0621633

Enable go modules for travis build

view details

push time in 21 days

push eventmiketonks/swag-validator

Mike Tonks

commit sha ff74a0534806830dc4fc399d3235d563cf5a040e

Fix broken tests aftern gojsonschema changes

view details

push time in 21 days

push eventmiketonks/swag-validator

Mike Tonks

commit sha d56bdc982f772eb8572d9f4162d1c1301f7d2531

Add CustomerLocale False() method for compatibility with gojsonschema

view details

push time in 21 days

push eventmiketonks/swag-validator

Mike Tonks

commit sha 9cd7727d16f4cbf99da93193e150681908e4f9cb

Updated .travis.yml

view details

push time in 21 days

push eventmiketonks/swag-validator

Mike Tonks

commit sha 903dd06348f33caea9a5697fcf9397591cbea33e

Added .travis.yaml

view details

push time in 22 days

issue openedsmartystreets/goconvey

Add support for TestTables (ConveyMany)

Hi,

We use Convey a lot and sometimes need to to table driven tests.

I did a TDD workshop recently and we looked at NUnit and pytest which both have nice syntax support for test tables.

In go, the for loop works ok but is not quite so elegant, and often times we've had problems with this especially in large Convey based tests with nested sections.

I wrote down a few ideas and started a proof-of-concept, creating ConveyMany as an add-on function around Convey.

My work so far is here: https://github.com/miketonks/conveymany

Inspiration and reflect tricks borrowed from Gingko Table extension: https://github.com/onsi/ginkgo/blob/master/extensions/table/table_entry.go

One main problem I have is the failure mode: when a test fails, it prints out a stack trace as well as the failure report, and I can't see why. Normally we don't get a stack trace for failures with standard Convey.

Another issue is that when a failure occurs, we don't know which test case failed, so a way to add this to the report is needed.

Additionally, I wondered if you would consider a feature request and help me to integrate this idea properly into goconvey.

created time in 22 days

create barnchmiketonks/conveymany

branch : master

created branch time in 22 days

created repositorymiketonks/conveymany

TestTables for go-convey

created time in 22 days

push eventmiketonks/testy

Mike Tonks

commit sha 1a8f86b15afa39730187b909dbeaa4be9a2f315d

Add SetResult method

view details

push time in 22 days

push eventmiketonks/testy

Mike Tonks

commit sha 5c04fee60df9b08592ae42b17716e4f003c895b9

Handle query params

view details

push time in 22 days

push eventmiketonks/testy

Mike Tonks

commit sha bab787dcad93d7240eadcc61eb7d32e689b5f057

Added Post method (only supports []byte for now)

view details

push time in 23 days

push eventmiketonks/testy

Mike Tonks

commit sha eb1b301154bde41b76864319058d34dc0122a02a

Added Patch method

view details

push time in 23 days

push eventmiketonks/testy

miketonks

commit sha 879c08767885b08fddf08a5787d08e3721b5404c

Update README.md

view details

push time in 23 days

push eventmiketonks/testy

Mike Tonks

commit sha e890aaba207defc6dcb9d07ba8010077d4674fad

Add github urls

view details

push time in 24 days

create barnchmiketonks/testy

branch : master

created branch time in 24 days

created repositorymiketonks/testy

Simple client library for testing HTTP and REST apis inspired by resty

created time in 24 days

fork miketonks/resty

Simple HTTP and REST client library for Go

fork in 25 days

delete branch miketonks/Kafka-Librd

delete branch : flush

delete time in a month

pull request commentplicease/Kafka-Librd

Add flush method, and explicit topic destroy

Thanks for the feedback. Updated now.

miketonks

comment created time in a month

push eventmiketonks/Kafka-Librd

Mike Tonks

commit sha c6f2ce84e2d074a3db7445ef12e79c0e8e69333f

Add flush method, and explicit topic destroy

view details

push time in a month

PR opened plicease/Kafka-Librd

Add flush method, and explicit topic destroy

I noticed one of my test scripts sometimes doesn't shut down correctly.

From the librdkafka docs:

The proper termination sequence for Producers is:

 /* 1) Make sure all outstanding requests are transmitted and handled. */
 rd_kafka_flush(rk, 60*1000); /* One minute timeout */

 /* 2) Destroy the topic and handle objects */
 rd_kafka_topic_destroy(rkt);  /* Repeat for all topic objects held */
 rd_kafka_destroy(rk);

https://github.com/edenhill/librdkafka/blob/master/INTRODUCTION.md#termination

So I added the flush method and en explicit destroy for topic, and this seems to help

#!/usr/bin/env perl
use 5.014;
use strict;
use warnings;

use Kafka::Librd;
my $brokers = "localhost:9092";
my $topic = "test";

my $key = 1; # use partition key to messages are received in order

my $kafka = Kafka::Librd->new(Kafka::Librd::RD_KAFKA_PRODUCER, {});
print "VERSION: " . Kafka::Librd::rd_kafka_version();

my $added = $kafka->brokers_add($brokers);
say "Added $added brokers";

my $ktopic = $kafka->topic( $topic, {} );

send_message("start >>>>>");
sleep 1;

for (my $i=1; $i <= 10; $i++) {
   my $err = send_message("message: $i");
   $err and die "Couldn't produce: ", Kafka::Librd::Error::to_string($err);
   print "$i\n";
}

sleep 1;
send_message("end >>>");

#sleep 1 while $kafka->outq_len;

$kafka->flush(1000);
$kafka->destroy();

while (Kafka::Librd::rd_kafka_wait_destroyed(1000) == -1) {
  say "Some kafka resources are still allocated";
}
say "Shutdown complete";

sub send_message {
  my ($message) = @_;
  my $err = $ktopic->produce( -1, 0, $message, $key );
  $err and die "Couldn't produce: ", Kafka::Librd::Error::to_string($err);
}
+23 -1

0 comment

2 changed files

pr created time in a month

create barnchmiketonks/Kafka-Librd

branch : flush

created branch time in a month

push eventmiketonks/Kafka-Librd

push time in a month

push eventmiketonks/Kafka-Librd

Mike Tonks

commit sha cc4649c528a71621a8810f190e00326f59ee5d0a

Add flush method, and explicit topic destroy

view details

push time in a month

fork miketonks/Kafka-Librd

perl bindings to librdkafka

fork in a month

issue closedinfluxdata/telegraf

[[inputs.mongodb]] Allow option to filter the list of db where perdb stats are collected

Feature Request

Proposal:

Add config options to specify which dbs to gather metrics for, or to exclude.

Current behavior:

The MongoDB input plugin has an option to filter the list of dbs where collection level stats are gathered.

Both perdb and collection level stats can be enabled or disabled.

  ## When true, collect per database stats
  # gather_perdb_stats = false

  ## When true, collect per collection stats
  # gather_col_stats = false

  ## List of db where collections stats are collected
  ## If empty, all db are concerned
  # col_stats_dbs = ["local"]

Currently there is no setting to filter which databases the perdb stats are gathered for.

Desired behavior:

Allow to specify perdb_stats_dbs and perdb_stats_dbs_exclude.

Add support for glob matching.

  ## When true, collect per database stats
  # gather_perdb_stats = false

  ## List of dbs where per database stats are collected
  ## If empty, all db are concerned
  # perdb_stats_dbs = ["local", "production*"]

  ## List of dbs where per database stats are excluded
  # perdb_stats_dbs_exclude = ["test*"]

Use case: Large number of Databases

We have a system which creates a large number of mongo databases (one per customer).

We do not wish to gather perdb metrics for these, as will will generate a lot of data. We would like to gather metrics for just specific dbs.

closed time in 2 months

miketonks

issue commentinfluxdata/telegraf

[[inputs.mongodb]] Allow option to filter the list of db where perdb stats are collected

Confirmed: tagdrop works, no need for code change :)

miketonks

comment created time in 2 months

issue commentinfluxdata/telegraf

[[inputs.mongodb]] Allow option to filter the list of db where perdb stats are collected

Just realised tagdrop may already provide this feature...

[[inputs.cpu]]
  percpu = true
  totalcpu = false
  fielddrop = ["cpu_time"]
  # Don't collect CPU data for cpu6 & cpu7
  [inputs.cpu.tagdrop]
    cpu = [ "cpu6", "cpu7" ]
miketonks

comment created time in 2 months

create barnchmiketonks/telegraf

branch : mongodb-perdb-filters

created branch time in 2 months

issue openedinfluxdata/telegraf

[[inputs.mongodb]] Allow option to filter the list of db where perdb stats are collected

Feature Request

Proposal:

Add config options to specify which dbs to gather metrics for, or to exclude.

Current behavior:

The MongoDB input plugin has an option to filter the list of dbs where collection level stats are gathered.

Both perdb and collection level stats can be enabled or disabled.

  ## When true, collect per database stats
  # gather_perdb_stats = false

  ## When true, collect per collection stats
  # gather_col_stats = false

  ## List of db where collections stats are collected
  ## If empty, all db are concerned
  # col_stats_dbs = ["local"]

Currently there is no setting to filter which databases the perdb stats are gathered for.

Desired behavior:

Allow to specify perdb_stats_dbs and perdb_stats_dbs_exclude.

Add support for glob matching.

  ## When true, collect per database stats
  # gather_perdb_stats = false

  ## List of dbs where per database stats are collected
  ## If empty, all db are concerned
  # perdb_stats_dbs = ["local", "production*"]

  ## List of dbs where per database stats are excluded
  # perdb_stats_dbs_exclude = ["test*"]

Use case: Large number of Databases

We have a system which creates a large number of mongo databases (one per customer).

We do not wish to gather perdb metrics for these, as will will generate a lot of data. We would like to gather metrics for just specific dbs.

created time in 2 months

startedwagoodman/dive

started time in 2 months

MemberEvent

push eventmiketonks/swag-validator

Mike Tonks

commit sha bb77a3f29b785c02f40f5bc5f722d453a49196b6

Don't eat errors in echo middleware

view details

push time in 2 months

push eventmiketonks/swag-validator

Edvinas Navasaitis

commit sha 59fc18810bda80af2f38558a3ef3f51bdcc25226

echo middleware

view details

Edvinas Navasaitis

commit sha 6f04b232995e7fe05a22f3e4f3e33e9454ed01ca

add unit tests for echo validator

view details

miketonks

commit sha 57fb2ecacfd03829d111a11587db7138ed85f370

Merge pull request #12 from miketonks/f-echo-middleware echo middleware

view details

push time in 2 months

PR merged miketonks/swag-validator

echo middleware
+1107 -473

0 comment

5 changed files

ednavas

pr closed time in 2 months

startedsqshq/sampler

started time in 3 months

more