func TestGetLogtime(t *testing.T) {
	fn1 := parser.PTFileName{Name: "20160112T00:45:44Z_ALL27409.paris"}
	t1, err1 := parser.GetLogtime(fn1)
	if err1 != nil || t1.String() != "2016-01-12 00:45:44 +0000 UTC" {
		t.Errorf("Error in parsing log time from legacy filename!\n")
	}
	fn2 := parser.PTFileName{Name: "20170320T23:53:10Z-172.17.94.34-33456-74.125.224.100-33457.paris"}
	t2, err2 := parser.GetLogtime(fn2)
	if err2 != nil || t2.String() != "2017-03-20 23:53:10 +0000 UTC" {
		t.Errorf("Error in parsing log time from 5-tuple filename!\n")
	}
	fn3 := parser.PTFileName{Name: "20190908T000148Z_ndt-74mqr_1565960097_000000000006DBCC.jsonl"}
	t3, err3 := parser.GetLogtime(fn3)
	if err3 != nil || t3.String() != "2019-09-08 00:01:48 +0000 UTC" {
		t.Errorf("Error in parsing log time from scamper Json filename!\n")
	}
}
TODO: IPv6 tests
package parser_test
import (
	"fmt"
	"io/ioutil"
	"path/filepath"
	"reflect"
	"testing"
	"time"
	"cloud.google.com/go/bigquery"
	"github.com/go-test/deep"
	"github.com/m-lab/annotation-service/api"
	v2 "github.com/m-lab/annotation-service/api/v2"
	"github.com/m-lab/etl/parser"
	"github.com/m-lab/etl/schema"
)
func TestParsePT(t *testing.T) {
	fileName := "20190825T000138Z_ndt-plh7v_1566050090_000000000004D64D.json"
	bytes, err := ioutil.ReadFile(filepath.Join("testdata/PT", fileName))
	if err != nil {
		t.Fatalf("failed to read file (error: %v)", err)
	}
	_, err = parser.ParsePT(fileName, bytes, "", "")
	if err != nil {
		t.Fatalf("failed to parse file %v (error: %v)", fileName, err)
	}
	fileName = "20190825T000138Z_ndt-plh7v_1566050090_000000000004D64E.json"
	bytes, err = ioutil.ReadFile(filepath.Join("testdata/PT", fileName))
	if err != nil {
		t.Fatalf("failed to read file (error: %v)", err)
	}
	got, err := parser.ParsePT(fileName, bytes, "", "fake.tgz")
	if err != nil {
		t.Fatalf("failed to parse file %v (error: %v)", fileName, err)
	}
	wantUUID := "ndt-rfwqf_1588021292_0000000000000242"
	if got.UUID != wantUUID {
		t.Fatalf("failed to parse UUID, wanted %q, got %q", wantUUID, got.UUID)
	}
	if !got.TestTime.Equal(time.Date(2019, 8, 25, 0, 1, 38, 0, time.UTC)) {
		t.Fatalf("failed to parse test time, wanted %v, got %v", "2019-08-25 01:38:00 +0000 UTC", got.TestTime)
	}
	if got.Parseinfo.Filename != fileName {
		t.Fatalf("failed to parse file name, wanted %v, got %v", fileName, got.Parseinfo.Filename)
	}
	fileName = "20210318T190500Z_ndt-klnff_1613689019_00000000000E86B8.json"
	bytes, err = ioutil.ReadFile(filepath.Join("testdata/PT", fileName))
	if err != nil {
		t.Fatalf("failed to parse file %v (error: %v)", fileName, err)
	}
	got, err = parser.ParsePT(fileName, bytes, "", "")
	if err != nil {
		t.Fatalf("failed to parse file %v (error: %v)", fileName, err)
	}
	wantUUID = "ndt-klnff_1613689019_00000000000E86B8"
	if got.UUID != wantUUID {
		t.Fatalf("failed to parse UUID, wanted %q, got %q", wantUUID, got.UUID)
	}
	if !got.TestTime.Equal(time.Date(2021, 3, 18, 19, 5, 0, 0, time.UTC)) {
		t.Fatalf("failed to parse test time, wanted %v, got %v", "2021-03-18 19:05:00 +0000 UTC", got.TestTime)
	}
	if got.Parseinfo.Filename != fileName {
		t.Fatalf("failed to parse file name, wanted %v, got %v", fileName, got.Parseinfo.Filename)
	}
}