From 768b487e993de057e57f79d9ef51d1688281fdaa Mon Sep 17 00:00:00 2001 From: Nathaniel Caza Date: Wed, 24 Aug 2022 11:59:32 -0500 Subject: [PATCH 1/4] move smoketest to test/smoketest --- CONTRIBUTING.md | 2 +- Makefile | 4 ++-- devtools/ci/tasks/scripts/test-smoketest.sh | 2 +- devtools/psql-lite/main.go | 2 +- docs/development-setup.md | 2 +- {smoketest => test/smoketest}/README.md | 0 .../smoketest}/addrules_test.go | 2 +- .../smoketest}/alertcleanup_test.go | 5 ++--- .../smoketest}/alertlog_test.go | 20 +++++++++---------- .../smoketest}/calendarsubscription_test.go | 2 +- .../smoketest}/cmtestdisable_test.go | 2 +- .../smoketest}/dedupnotifications_test.go | 4 ++-- .../smoketest}/deleteescalationpolicy_test.go | 2 +- .../smoketest}/deleterotation_test.go | 2 +- .../smoketest}/emailnotification_test.go | 3 +-- .../smoketest}/escalation_test.go | 2 +- .../smoketest}/escalationgap_test.go | 2 +- .../smoketest}/escalationnotification_test.go | 2 +- .../smoketest}/genericapi_test.go | 3 +-- .../smoketest}/genericapiclose_test.go | 3 +-- .../smoketest}/genericapidedup_test.go | 2 +- {smoketest => test/smoketest}/grafana_test.go | 3 ++- .../smoketest}/graphqlalert_test.go | 2 +- .../smoketest}/graphqlalertlogs_test.go | 2 +- .../smoketest}/graphqlalertsort_test.go | 3 +-- .../graphqlcalendarsubscriptions_test.go | 2 +- .../smoketest}/graphqlcreateschedule_test.go | 2 +- ...aphqlcreatescheduledefaultrotation_test.go | 2 +- .../graphqlfavoriterotations_test.go | 3 ++- .../smoketest}/graphqlmultiplealerts_test.go | 3 +-- .../smoketest}/graphqlnotices_test.go | 2 +- .../smoketest}/graphqlnotifiedalerts_test.go | 2 +- .../smoketest}/graphqloncall_test.go | 3 +-- .../graphqloncallassignments_test.go | 3 +-- .../graphqlschedulefavorites_test.go | 3 +-- .../smoketest}/graphqlservicelabels_test.go | 3 +-- .../smoketest}/graphqlupdaterotation_test.go | 2 +- .../smoketest}/graphqluserfavorites_test.go | 3 +-- .../smoketest}/graphqlusers_test.go | 3 +-- .../smoketest}/harness/backend.go | 0 .../smoketest}/harness/datagen.go | 0 .../smoketest}/harness/email.go | 0 .../smoketest}/harness/graphql.go | 0 .../smoketest}/harness/harness.go | 0 .../smoketest}/harness/matchers.go | 0 .../smoketest}/harness/phoneassertions.go | 0 .../smoketest}/harness/slack.go | 0 {smoketest => test/smoketest}/harness/sql.go | 0 .../smoketest}/harness/sql_test.go | 0 .../smoketest}/harness/twilioassertionapi.go | 0 .../harness/twilioassertiondevice.go | 0 .../smoketest}/harness/twilioassertionsms.go | 0 .../harness/twilioassertionvoicecall.go | 0 .../smoketest}/heartbeat_test.go | 2 +- .../smoketest}/inprogress_test.go | 2 +- .../smoketest}/listalerts_test.go | 2 +- .../smoketest}/mailgunalerts_test.go | 2 +- .../manualescalationnotification_test.go | 2 +- .../smoketest}/manyalerts_test.go | 3 +-- .../smoketest}/messagebundlesms_test.go | 2 +- .../smoketest}/messagebundlevoice_test.go | 2 +- .../smoketest}/migrations_test.go | 2 +- .../smoketest}/missinguser_test.go | 2 +- .../smoketest}/multistepnotification_test.go | 3 +-- .../smoketest}/multiuser_test.go | 2 +- .../smoketest}/oncallnotify_test.go | 2 +- .../smoketest}/oncallnotifytod_test.go | 2 +- .../smoketest}/overrideconflict_test.go | 2 +- .../smoketest}/policyreassignment_test.go | 2 +- .../smoketest}/postcyclerules_test.go | 2 +- .../smoketest}/prioritization_test.go | 2 +- .../smoketest}/prometheusalertmanager_test.go | 2 +- .../smoketest}/rotationdaily_test.go | 3 ++- .../smoketest}/rotationdeluser_test.go | 2 +- .../smoketest}/rotationdst_test.go | 4 ++-- .../smoketest}/rotationgap_test.go | 3 ++- .../smoketest}/rotationhourly_test.go | 3 +-- .../smoketest}/rotationweekly_test.go | 3 ++- .../smoketest}/rotationwrap_test.go | 4 ++-- .../smoketest}/schedulerule_test.go | 3 ++- .../servicemaintenancealert_test.go | 2 +- .../servicemaintenanceescalate_test.go | 2 +- .../smoketest}/simplenotification_test.go | 2 +- .../smoketest}/site24x7_test.go | 2 +- .../smoketest}/slackaddtoepstep_test.go | 3 +-- .../smoketest}/slackchannels_test.go | 3 ++- .../smoketest}/slackinteraction_test.go | 2 +- .../smoketest}/slacknotification_test.go | 2 +- .../smoketest}/statusinprogress_test.go | 2 +- .../smoketest}/statusupdates_test.go | 2 +- .../smoketest}/statusupdatescancel_test.go | 3 +-- .../smoketest}/statusupdateschannel_test.go | 2 +- .../smoketest}/switchover_test.go | 2 +- .../smoketest}/systemlimits_test.go | 3 +-- .../smoketest}/tempschedules_test.go | 2 +- .../smoketest}/twilioenablebysms_test.go | 2 +- .../smoketest}/twilioenablebyvoice_test.go | 2 +- .../smoketest}/twilioonewaysms_test.go | 2 +- .../smoketest}/twiliosid_test.go | 2 +- .../smoketest}/twiliosmsack_test.go | 2 +- .../smoketest}/twiliosmsclose_test.go | 2 +- .../smoketest}/twiliosmsfailure_test.go | 2 +- .../smoketest}/twiliosmsfromoverride_test.go | 3 +-- .../smoketest}/twiliosmsreplycode_test.go | 2 +- .../smoketest}/twiliosmsreplyignore_test.go | 3 +-- .../smoketest}/twiliosmsreplylast_test.go | 2 +- .../smoketest}/twiliosmsreplylimit_test.go | 3 +-- .../smoketest}/twiliosmsstopstart_test.go | 2 +- .../smoketest}/twiliosmstrailingspace_test.go | 2 +- .../smoketest}/twiliosmsurl_test.go | 4 +--- .../smoketest}/twiliosmsverification_test.go | 2 +- .../smoketest}/twiliotestsms_test.go | 2 +- .../smoketest}/twiliotestvoice_test.go | 2 +- .../smoketest}/twiliovoiceack_test.go | 2 +- .../smoketest}/twiliovoiceclose_test.go | 2 +- .../twiliovoiceemptymessage_test.go | 2 +- .../smoketest}/twiliovoicefailure_test.go | 2 +- .../smoketest}/twiliovoicestop_test.go | 2 +- .../twiliovoiceverification_test.go | 2 +- {smoketest => test/smoketest}/upload.sh | 2 +- {smoketest => test/smoketest}/webhook_test.go | 2 +- web/src/.gitignore | 1 - 122 files changed, 127 insertions(+), 144 deletions(-) rename {smoketest => test/smoketest}/README.md (100%) rename {smoketest => test/smoketest}/addrules_test.go (97%) rename {smoketest => test/smoketest}/alertcleanup_test.go (96%) rename {smoketest => test/smoketest}/alertlog_test.go (90%) rename {smoketest => test/smoketest}/calendarsubscription_test.go (97%) rename {smoketest => test/smoketest}/cmtestdisable_test.go (94%) rename {smoketest => test/smoketest}/dedupnotifications_test.go (92%) rename {smoketest => test/smoketest}/deleteescalationpolicy_test.go (94%) rename {smoketest => test/smoketest}/deleterotation_test.go (95%) rename {smoketest => test/smoketest}/emailnotification_test.go (95%) rename {smoketest => test/smoketest}/escalation_test.go (96%) rename {smoketest => test/smoketest}/escalationgap_test.go (95%) rename {smoketest => test/smoketest}/escalationnotification_test.go (97%) rename {smoketest => test/smoketest}/genericapi_test.go (97%) rename {smoketest => test/smoketest}/genericapiclose_test.go (98%) rename {smoketest => test/smoketest}/genericapidedup_test.go (98%) rename {smoketest => test/smoketest}/grafana_test.go (96%) rename {smoketest => test/smoketest}/graphqlalert_test.go (99%) rename {smoketest => test/smoketest}/graphqlalertlogs_test.go (97%) rename {smoketest => test/smoketest}/graphqlalertsort_test.go (97%) rename {smoketest => test/smoketest}/graphqlcalendarsubscriptions_test.go (98%) rename {smoketest => test/smoketest}/graphqlcreateschedule_test.go (97%) rename {smoketest => test/smoketest}/graphqlcreatescheduledefaultrotation_test.go (97%) rename {smoketest => test/smoketest}/graphqlfavoriterotations_test.go (97%) rename {smoketest => test/smoketest}/graphqlmultiplealerts_test.go (98%) rename {smoketest => test/smoketest}/graphqlnotices_test.go (96%) rename {smoketest => test/smoketest}/graphqlnotifiedalerts_test.go (98%) rename {smoketest => test/smoketest}/graphqloncall_test.go (99%) rename {smoketest => test/smoketest}/graphqloncallassignments_test.go (99%) rename {smoketest => test/smoketest}/graphqlschedulefavorites_test.go (97%) rename {smoketest => test/smoketest}/graphqlservicelabels_test.go (96%) rename {smoketest => test/smoketest}/graphqlupdaterotation_test.go (98%) rename {smoketest => test/smoketest}/graphqluserfavorites_test.go (97%) rename {smoketest => test/smoketest}/graphqlusers_test.go (97%) rename {smoketest => test/smoketest}/harness/backend.go (100%) rename {smoketest => test/smoketest}/harness/datagen.go (100%) rename {smoketest => test/smoketest}/harness/email.go (100%) rename {smoketest => test/smoketest}/harness/graphql.go (100%) rename {smoketest => test/smoketest}/harness/harness.go (100%) rename {smoketest => test/smoketest}/harness/matchers.go (100%) rename {smoketest => test/smoketest}/harness/phoneassertions.go (100%) rename {smoketest => test/smoketest}/harness/slack.go (100%) rename {smoketest => test/smoketest}/harness/sql.go (100%) rename {smoketest => test/smoketest}/harness/sql_test.go (100%) rename {smoketest => test/smoketest}/harness/twilioassertionapi.go (100%) rename {smoketest => test/smoketest}/harness/twilioassertiondevice.go (100%) rename {smoketest => test/smoketest}/harness/twilioassertionsms.go (100%) rename {smoketest => test/smoketest}/harness/twilioassertionvoicecall.go (100%) rename {smoketest => test/smoketest}/heartbeat_test.go (97%) rename {smoketest => test/smoketest}/inprogress_test.go (98%) rename {smoketest => test/smoketest}/listalerts_test.go (96%) rename {smoketest => test/smoketest}/mailgunalerts_test.go (98%) rename {smoketest => test/smoketest}/manualescalationnotification_test.go (97%) rename {smoketest => test/smoketest}/manyalerts_test.go (97%) rename {smoketest => test/smoketest}/messagebundlesms_test.go (97%) rename {smoketest => test/smoketest}/messagebundlevoice_test.go (97%) rename {smoketest => test/smoketest}/migrations_test.go (99%) rename {smoketest => test/smoketest}/missinguser_test.go (98%) rename {smoketest => test/smoketest}/multistepnotification_test.go (96%) rename {smoketest => test/smoketest}/multiuser_test.go (97%) rename {smoketest => test/smoketest}/oncallnotify_test.go (97%) rename {smoketest => test/smoketest}/oncallnotifytod_test.go (96%) rename {smoketest => test/smoketest}/overrideconflict_test.go (96%) rename {smoketest => test/smoketest}/policyreassignment_test.go (97%) rename {smoketest => test/smoketest}/postcyclerules_test.go (96%) rename {smoketest => test/smoketest}/prioritization_test.go (97%) rename {smoketest => test/smoketest}/prometheusalertmanager_test.go (97%) rename {smoketest => test/smoketest}/rotationdaily_test.go (97%) rename {smoketest => test/smoketest}/rotationdeluser_test.go (96%) rename {smoketest => test/smoketest}/rotationdst_test.go (97%) rename {smoketest => test/smoketest}/rotationgap_test.go (96%) rename {smoketest => test/smoketest}/rotationhourly_test.go (97%) rename {smoketest => test/smoketest}/rotationweekly_test.go (97%) rename {smoketest => test/smoketest}/rotationwrap_test.go (97%) rename {smoketest => test/smoketest}/schedulerule_test.go (97%) rename {smoketest => test/smoketest}/servicemaintenancealert_test.go (97%) rename {smoketest => test/smoketest}/servicemaintenanceescalate_test.go (97%) rename {smoketest => test/smoketest}/simplenotification_test.go (98%) rename {smoketest => test/smoketest}/site24x7_test.go (97%) rename {smoketest => test/smoketest}/slackaddtoepstep_test.go (95%) rename {smoketest => test/smoketest}/slackchannels_test.go (96%) rename {smoketest => test/smoketest}/slackinteraction_test.go (97%) rename {smoketest => test/smoketest}/slacknotification_test.go (95%) rename {smoketest => test/smoketest}/statusinprogress_test.go (97%) rename {smoketest => test/smoketest}/statusupdates_test.go (98%) rename {smoketest => test/smoketest}/statusupdatescancel_test.go (98%) rename {smoketest => test/smoketest}/statusupdateschannel_test.go (96%) rename {smoketest => test/smoketest}/switchover_test.go (89%) rename {smoketest => test/smoketest}/systemlimits_test.go (99%) rename {smoketest => test/smoketest}/tempschedules_test.go (98%) rename {smoketest => test/smoketest}/twilioenablebysms_test.go (97%) rename {smoketest => test/smoketest}/twilioenablebyvoice_test.go (97%) rename {smoketest => test/smoketest}/twilioonewaysms_test.go (96%) rename {smoketest => test/smoketest}/twiliosid_test.go (97%) rename {smoketest => test/smoketest}/twiliosmsack_test.go (96%) rename {smoketest => test/smoketest}/twiliosmsclose_test.go (96%) rename {smoketest => test/smoketest}/twiliosmsfailure_test.go (96%) rename {smoketest => test/smoketest}/twiliosmsfromoverride_test.go (97%) rename {smoketest => test/smoketest}/twiliosmsreplycode_test.go (96%) rename {smoketest => test/smoketest}/twiliosmsreplyignore_test.go (94%) rename {smoketest => test/smoketest}/twiliosmsreplylast_test.go (96%) rename {smoketest => test/smoketest}/twiliosmsreplylimit_test.go (96%) rename {smoketest => test/smoketest}/twiliosmsstopstart_test.go (97%) rename {smoketest => test/smoketest}/twiliosmstrailingspace_test.go (96%) rename {smoketest => test/smoketest}/twiliosmsurl_test.go (98%) rename {smoketest => test/smoketest}/twiliosmsverification_test.go (96%) rename {smoketest => test/smoketest}/twiliotestsms_test.go (94%) rename {smoketest => test/smoketest}/twiliotestvoice_test.go (94%) rename {smoketest => test/smoketest}/twiliovoiceack_test.go (96%) rename {smoketest => test/smoketest}/twiliovoiceclose_test.go (96%) rename {smoketest => test/smoketest}/twiliovoiceemptymessage_test.go (96%) rename {smoketest => test/smoketest}/twiliovoicefailure_test.go (95%) rename {smoketest => test/smoketest}/twiliovoicestop_test.go (96%) rename {smoketest => test/smoketest}/twiliovoiceverification_test.go (97%) rename {smoketest => test/smoketest}/upload.sh (93%) rename {smoketest => test/smoketest}/webhook_test.go (97%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8e8c5d6cf9..fd2a3016b5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -35,5 +35,5 @@ Be sure to run `make check` and tests before opening a PR to catch common errors ### Backend Change Guidelines - Use unit tests as a tool to validate complex logic. For [example](./schedule/rule/weekdayfilter_test.go). -- New functionality should have a behavioral smoketest at a minimum. For [example](./smoketest/simplenotification_test.go). Documentation on our smoketest framework can be found [here](./smoketest/README.md). +- New functionality should have a behavioral smoketest at a minimum. For [example](./test/smoketest/simplenotification_test.go). Documentation on our smoketest framework can be found [here](./test/smoketest/README.md). - Go code should [follow best practices](https://golang.org/doc/effective_go.html), exported functions/methods should be commented, etc.. diff --git a/Makefile b/Makefile index 954a895823..e3b79c6cbc 100644 --- a/Makefile +++ b/Makefile @@ -144,10 +144,10 @@ generate: node_modules pkg/sysapi/sysapi.pb.go pkg/sysapi/sysapi_grpc.pb.go go generate ./... smoketest: - (cd smoketest && go test -parallel 10 -timeout 20m) + (cd test/smoketest && go test -parallel 10 -timeout 20m) test-migrations: bin/goalert - (cd smoketest && go test -run TestMigrations) + (cd test/smoketest && go test -run TestMigrations) tools: go get -u golang.org/x/tools/cmd/gorename diff --git a/devtools/ci/tasks/scripts/test-smoketest.sh b/devtools/ci/tasks/scripts/test-smoketest.sh index 9e84578ad7..b20b6e5898 100755 --- a/devtools/ci/tasks/scripts/test-smoketest.sh +++ b/devtools/ci/tasks/scripts/test-smoketest.sh @@ -2,6 +2,6 @@ set -x start_postgres -trap "stop_postgres; tar czf ../debug/debug-$(date +%Y%m%d%H%M%S)-$(git rev-parse HEAD)-smoketest.tgz -C .. goalert/smoketest/smoketest_db_dump" EXIT +trap "stop_postgres; tar czf ../debug/debug-$(date +%Y%m%d%H%M%S)-$(git rev-parse HEAD)-smoketest.tgz -C .. goalert/test/smoketest/smoketest_db_dump" EXIT make -e smoketest DB_URL=$DB_URL diff --git a/devtools/psql-lite/main.go b/devtools/psql-lite/main.go index 4e08022122..46cb7f092f 100644 --- a/devtools/psql-lite/main.go +++ b/devtools/psql-lite/main.go @@ -5,7 +5,7 @@ import ( "flag" "log" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) func main() { diff --git a/docs/development-setup.md b/docs/development-setup.md index b2a60a794c..915b41b4c6 100644 --- a/docs/development-setup.md +++ b/docs/development-setup.md @@ -80,7 +80,7 @@ of the GoAlert server component. Run the full suite with `make smoketest`. -More information about smoketests can be found [here](../smoketest/README.md). +More information about smoketests can be found [here](../test/smoketest/README.md). ### Running Unit Tests diff --git a/smoketest/README.md b/test/smoketest/README.md similarity index 100% rename from smoketest/README.md rename to test/smoketest/README.md diff --git a/smoketest/addrules_test.go b/test/smoketest/addrules_test.go similarity index 97% rename from smoketest/addrules_test.go rename to test/smoketest/addrules_test.go index f47059c42f..e63c1060a6 100644 --- a/smoketest/addrules_test.go +++ b/test/smoketest/addrules_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) /* diff --git a/smoketest/alertcleanup_test.go b/test/smoketest/alertcleanup_test.go similarity index 96% rename from smoketest/alertcleanup_test.go rename to test/smoketest/alertcleanup_test.go index 0b98223a4f..a01afad5ed 100644 --- a/smoketest/alertcleanup_test.go +++ b/test/smoketest/alertcleanup_test.go @@ -1,12 +1,11 @@ package smoketest import ( - "testing" - "encoding/json" + "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestAlertCleanup verifies that old alerts are purged from the DB diff --git a/smoketest/alertlog_test.go b/test/smoketest/alertlog_test.go similarity index 90% rename from smoketest/alertlog_test.go rename to test/smoketest/alertlog_test.go index 99a2980090..a77577770c 100644 --- a/smoketest/alertlog_test.go +++ b/test/smoketest/alertlog_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) func TestAlertLog(t *testing.T) { @@ -141,7 +141,7 @@ func TestAlertLog(t *testing.T) { EPStep: true, EPStepUser: true, }, nil, func(t *testing.T, h *harness.Harness, l alertLogs) { - var msg = l.Alert.RecentEvents.Nodes[0].Message + msg := l.Alert.RecentEvents.Nodes[0].Message assert.Contains(t, msg, "Notification sent") h.Twilio(t).Device(h.Phone("1")).ExpectSMS("Alert #1: foo") }) @@ -154,7 +154,7 @@ func TestAlertLog(t *testing.T) { EPStep: true, EPStepUser: true, }, nil, func(t *testing.T, h *harness.Harness, l alertLogs) { - var details = l.Alert.RecentEvents.Nodes[0].State.Details + details := l.Alert.RecentEvents.Nodes[0].State.Details assert.Contains(t, details, "contact method disabled") }) @@ -168,8 +168,8 @@ func TestAlertLog(t *testing.T) { }, func(t *testing.T, h *harness.Harness) { h.Twilio(t).Device(h.Phone("1")).RejectSMS("Alert #1: foo") }, func(t *testing.T, h *harness.Harness, l alertLogs) { - var msg = l.Alert.RecentEvents.Nodes[0].Message - var details = l.Alert.RecentEvents.Nodes[0].State.Details + msg := l.Alert.RecentEvents.Nodes[0].Message + details := l.Alert.RecentEvents.Nodes[0].State.Details assert.Contains(t, msg, "Notification sent") assert.Equal(t, "failed", details) }) @@ -184,8 +184,8 @@ func TestAlertLog(t *testing.T) { }, func(t *testing.T, h *harness.Harness) { h.Twilio(t).Device(h.Phone("1")).RejectVoice("foo") }, func(t *testing.T, h *harness.Harness, l alertLogs) { - var msg = l.Alert.RecentEvents.Nodes[0].Message - var details = l.Alert.RecentEvents.Nodes[0].State.Details + msg := l.Alert.RecentEvents.Nodes[0].Message + details := l.Alert.RecentEvents.Nodes[0].State.Details assert.Contains(t, msg, "Notification sent") assert.Equal(t, "failed", details) }) @@ -198,7 +198,7 @@ func TestAlertLog(t *testing.T) { EPStep: true, EPStepUser: true, }, nil, func(t *testing.T, h *harness.Harness, l alertLogs) { - var msg = l.Alert.RecentEvents.Nodes[0].Message + msg := l.Alert.RecentEvents.Nodes[0].Message assert.Contains(t, msg, "no immediate rule") }) @@ -210,7 +210,7 @@ func TestAlertLog(t *testing.T) { EPStep: true, EPStepUser: false, }, nil, func(t *testing.T, h *harness.Harness, l alertLogs) { - var details = l.Alert.RecentEvents.Nodes[0].State.Details + details := l.Alert.RecentEvents.Nodes[0].State.Details assert.Contains(t, details, "No one was on-call") }) @@ -222,7 +222,7 @@ func TestAlertLog(t *testing.T) { EPStep: false, EPStepUser: false, }, nil, func(t *testing.T, h *harness.Harness, l alertLogs) { - var details = l.Alert.RecentEvents.Nodes[0].State.Details + details := l.Alert.RecentEvents.Nodes[0].State.Details assert.Contains(t, details, "No escalation policy steps") }) } diff --git a/smoketest/calendarsubscription_test.go b/test/smoketest/calendarsubscription_test.go similarity index 97% rename from smoketest/calendarsubscription_test.go rename to test/smoketest/calendarsubscription_test.go index 26d26521cb..ea2cb48cba 100644 --- a/smoketest/calendarsubscription_test.go +++ b/test/smoketest/calendarsubscription_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) func TestCalendarSubscription(t *testing.T) { diff --git a/smoketest/cmtestdisable_test.go b/test/smoketest/cmtestdisable_test.go similarity index 94% rename from smoketest/cmtestdisable_test.go rename to test/smoketest/cmtestdisable_test.go index eabae816b0..98e67b7d25 100644 --- a/smoketest/cmtestdisable_test.go +++ b/test/smoketest/cmtestdisable_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestCMTestDisable checks for a condition where a test message is scheduled but the contact method is immediately disabled. diff --git a/smoketest/dedupnotifications_test.go b/test/smoketest/dedupnotifications_test.go similarity index 92% rename from smoketest/dedupnotifications_test.go rename to test/smoketest/dedupnotifications_test.go index 6afb476c9d..103b7afcff 100644 --- a/smoketest/dedupnotifications_test.go +++ b/test/smoketest/dedupnotifications_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestDedupNotifications tests that if a single contact method is @@ -50,7 +50,7 @@ func TestDedupNotifications(t *testing.T) { h := harness.NewHarness(t, sql, "escalation-policy-step-reorder") defer h.Close() - //Test that after 3 minutes, only 1 notification is generated + // Test that after 3 minutes, only 1 notification is generated h.FastForward(time.Minute * 3) h.Twilio(t).Device(h.Phone("1")).ExpectSMS("testing") diff --git a/smoketest/deleteescalationpolicy_test.go b/test/smoketest/deleteescalationpolicy_test.go similarity index 94% rename from smoketest/deleteescalationpolicy_test.go rename to test/smoketest/deleteescalationpolicy_test.go index 834d7b920d..72c44367d9 100644 --- a/smoketest/deleteescalationpolicy_test.go +++ b/test/smoketest/deleteescalationpolicy_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestDeleteEscalationPolicy tests that it is possible to delete an escalation policy diff --git a/smoketest/deleterotation_test.go b/test/smoketest/deleterotation_test.go similarity index 95% rename from smoketest/deleterotation_test.go rename to test/smoketest/deleterotation_test.go index 91fc7631d6..841ba21905 100644 --- a/smoketest/deleterotation_test.go +++ b/test/smoketest/deleterotation_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestDeleteRotation tests that it is possible to delete a rotation with participants diff --git a/smoketest/emailnotification_test.go b/test/smoketest/emailnotification_test.go similarity index 95% rename from smoketest/emailnotification_test.go rename to test/smoketest/emailnotification_test.go index 62b52cd7e4..302ab6dc7d 100644 --- a/smoketest/emailnotification_test.go +++ b/test/smoketest/emailnotification_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestEmailNotification tests that email notifications are delivered. @@ -45,5 +45,4 @@ func TestEmailNotification(t *testing.T) { defer h.Close() h.SMTP().ExpectMessage(h.Email("1"), "testing") - } diff --git a/smoketest/escalation_test.go b/test/smoketest/escalation_test.go similarity index 96% rename from smoketest/escalation_test.go rename to test/smoketest/escalation_test.go index 8e8a51f3c3..12b575892e 100644 --- a/smoketest/escalation_test.go +++ b/test/smoketest/escalation_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestEscalation tests that alerts are escalated automatically, per the delay_minutes setting. diff --git a/smoketest/escalationgap_test.go b/test/smoketest/escalationgap_test.go similarity index 95% rename from smoketest/escalationgap_test.go rename to test/smoketest/escalationgap_test.go index 273c717aa5..98478e0781 100644 --- a/smoketest/escalationgap_test.go +++ b/test/smoketest/escalationgap_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestEscalationGap tests that escalation policy step discrepencies are handled. diff --git a/smoketest/escalationnotification_test.go b/test/smoketest/escalationnotification_test.go similarity index 97% rename from smoketest/escalationnotification_test.go rename to test/smoketest/escalationnotification_test.go index 245cce8b49..e896be8d17 100644 --- a/smoketest/escalationnotification_test.go +++ b/test/smoketest/escalationnotification_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestEscalationNotification ensures that notification rules diff --git a/smoketest/genericapi_test.go b/test/smoketest/genericapi_test.go similarity index 97% rename from smoketest/genericapi_test.go rename to test/smoketest/genericapi_test.go index 75cced2f36..6105d2d783 100644 --- a/smoketest/genericapi_test.go +++ b/test/smoketest/genericapi_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) func TestGenericAPI(t *testing.T) { @@ -73,5 +73,4 @@ func TestGenericAPI(t *testing.T) { resp.Body.Close() h.Twilio(t).Device(h.Phone("1")).ExpectSMS("json") - } diff --git a/smoketest/genericapiclose_test.go b/test/smoketest/genericapiclose_test.go similarity index 98% rename from smoketest/genericapiclose_test.go rename to test/smoketest/genericapiclose_test.go index 3a86a53028..62f603a9f5 100644 --- a/smoketest/genericapiclose_test.go +++ b/test/smoketest/genericapiclose_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) func TestGenericAPIClose(t *testing.T) { @@ -112,5 +112,4 @@ func TestGenericAPIClose(t *testing.T) { h.FastForward(30 * time.Minute) // closed, no SMS - } diff --git a/smoketest/genericapidedup_test.go b/test/smoketest/genericapidedup_test.go similarity index 98% rename from smoketest/genericapidedup_test.go rename to test/smoketest/genericapidedup_test.go index 667cb82d3e..93b51eb93b 100644 --- a/smoketest/genericapidedup_test.go +++ b/test/smoketest/genericapidedup_test.go @@ -6,7 +6,7 @@ import ( "net/url" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) func TestGenericAPIDedup(t *testing.T) { diff --git a/smoketest/grafana_test.go b/test/smoketest/grafana_test.go similarity index 96% rename from smoketest/grafana_test.go rename to test/smoketest/grafana_test.go index 2a43efb008..5deaadd3e8 100644 --- a/smoketest/grafana_test.go +++ b/test/smoketest/grafana_test.go @@ -2,9 +2,10 @@ package smoketest import ( "bytes" - "github.com/target/goalert/smoketest/harness" "net/http" "testing" + + "github.com/target/goalert/test/smoketest/harness" ) func TestGrafana(t *testing.T) { diff --git a/smoketest/graphqlalert_test.go b/test/smoketest/graphqlalert_test.go similarity index 99% rename from smoketest/graphqlalert_test.go rename to test/smoketest/graphqlalert_test.go index 722b3f3d4b..2e64024507 100644 --- a/smoketest/graphqlalert_test.go +++ b/test/smoketest/graphqlalert_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestGraphQLAlert tests that all steps up to, and including, generating diff --git a/smoketest/graphqlalertlogs_test.go b/test/smoketest/graphqlalertlogs_test.go similarity index 97% rename from smoketest/graphqlalertlogs_test.go rename to test/smoketest/graphqlalertlogs_test.go index ff73ae299c..88773d362f 100644 --- a/smoketest/graphqlalertlogs_test.go +++ b/test/smoketest/graphqlalertlogs_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestGraphQLAlertLogs tests that logs are properly generated for an alert. diff --git a/smoketest/graphqlalertsort_test.go b/test/smoketest/graphqlalertsort_test.go similarity index 97% rename from smoketest/graphqlalertsort_test.go rename to test/smoketest/graphqlalertsort_test.go index 4c6d0c32bd..12fe407299 100644 --- a/smoketest/graphqlalertsort_test.go +++ b/test/smoketest/graphqlalertsort_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestGraphQLAlertSort verifies that the alerts query sorts results properly. @@ -100,5 +100,4 @@ func TestGraphQLAlertSort(t *testing.T) { }`, &alerts3) assert.EqualValues(t, []node{{ID: 4}, {ID: 2}, {ID: 1}, {ID: 3}}, alerts3.Alerts.Nodes) - } diff --git a/smoketest/graphqlcalendarsubscriptions_test.go b/test/smoketest/graphqlcalendarsubscriptions_test.go similarity index 98% rename from smoketest/graphqlcalendarsubscriptions_test.go rename to test/smoketest/graphqlcalendarsubscriptions_test.go index d00591396d..e542b88451 100644 --- a/smoketest/graphqlcalendarsubscriptions_test.go +++ b/test/smoketest/graphqlcalendarsubscriptions_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) type calSub struct { diff --git a/smoketest/graphqlcreateschedule_test.go b/test/smoketest/graphqlcreateschedule_test.go similarity index 97% rename from smoketest/graphqlcreateschedule_test.go rename to test/smoketest/graphqlcreateschedule_test.go index 9c3b6ac457..60e63ae311 100644 --- a/smoketest/graphqlcreateschedule_test.go +++ b/test/smoketest/graphqlcreateschedule_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestGraphQLCreateSchedule tests that all steps for creating a schedule (without default rotation) are carried out without any errors. diff --git a/smoketest/graphqlcreatescheduledefaultrotation_test.go b/test/smoketest/graphqlcreatescheduledefaultrotation_test.go similarity index 97% rename from smoketest/graphqlcreatescheduledefaultrotation_test.go rename to test/smoketest/graphqlcreatescheduledefaultrotation_test.go index bde81768df..6a8e36eb77 100644 --- a/smoketest/graphqlcreatescheduledefaultrotation_test.go +++ b/test/smoketest/graphqlcreatescheduledefaultrotation_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestGraphQLCreateScheduleWithDefaultRotation tests that all steps for creating a schedule with default rotation are carried out without any errors. diff --git a/smoketest/graphqlfavoriterotations_test.go b/test/smoketest/graphqlfavoriterotations_test.go similarity index 97% rename from smoketest/graphqlfavoriterotations_test.go rename to test/smoketest/graphqlfavoriterotations_test.go index 2dedc8124c..dba6da38f1 100644 --- a/smoketest/graphqlfavoriterotations_test.go +++ b/test/smoketest/graphqlfavoriterotations_test.go @@ -3,8 +3,9 @@ package smoketest import ( "encoding/json" "fmt" - "github.com/target/goalert/smoketest/harness" "testing" + + "github.com/target/goalert/test/smoketest/harness" ) func TestGraphQLFavoriteRotations(t *testing.T) { diff --git a/smoketest/graphqlmultiplealerts_test.go b/test/smoketest/graphqlmultiplealerts_test.go similarity index 98% rename from smoketest/graphqlmultiplealerts_test.go rename to test/smoketest/graphqlmultiplealerts_test.go index 1c67e929de..1f17b6589d 100644 --- a/smoketest/graphqlmultiplealerts_test.go +++ b/test/smoketest/graphqlmultiplealerts_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestGraphQLMultipleAlerts tests that all steps up to, and including, generating @@ -120,5 +120,4 @@ func TestGraphQLMultipleAlerts(t *testing.T) { `, 1, 2, 3), nil) h.FastForward(1 * time.Minute) - } diff --git a/smoketest/graphqlnotices_test.go b/test/smoketest/graphqlnotices_test.go similarity index 96% rename from smoketest/graphqlnotices_test.go rename to test/smoketest/graphqlnotices_test.go index bfbb12264e..40eea96ac7 100644 --- a/smoketest/graphqlnotices_test.go +++ b/test/smoketest/graphqlnotices_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestNotices tests notices are properly returned given the appropriate scenarios. diff --git a/smoketest/graphqlnotifiedalerts_test.go b/test/smoketest/graphqlnotifiedalerts_test.go similarity index 98% rename from smoketest/graphqlnotifiedalerts_test.go rename to test/smoketest/graphqlnotifiedalerts_test.go index 8c6370715c..1e595203f9 100644 --- a/smoketest/graphqlnotifiedalerts_test.go +++ b/test/smoketest/graphqlnotifiedalerts_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestNotifiedAlerts tests that the alerts GraphQL query shows the proper amount of results when flipping between "includeNotified" and "favoritesOnly" query options. diff --git a/smoketest/graphqloncall_test.go b/test/smoketest/graphqloncall_test.go similarity index 99% rename from smoketest/graphqloncall_test.go rename to test/smoketest/graphqloncall_test.go index d7a85239e4..64ccfd900f 100644 --- a/smoketest/graphqloncall_test.go +++ b/test/smoketest/graphqloncall_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" "github.com/target/goalert/user" ) @@ -412,5 +412,4 @@ func TestGraphQLOnCall(t *testing.T) { } } `, false, false) - } diff --git a/smoketest/graphqloncallassignments_test.go b/test/smoketest/graphqloncallassignments_test.go similarity index 99% rename from smoketest/graphqloncallassignments_test.go rename to test/smoketest/graphqloncallassignments_test.go index bba19d54b8..774c0935f6 100644 --- a/smoketest/graphqloncallassignments_test.go +++ b/test/smoketest/graphqloncallassignments_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" "github.com/target/goalert/user" ) @@ -891,5 +891,4 @@ func TestGraphQLOnCallAssignments(t *testing.T) { {Service: "svc", EP: "ep", StepNumber: 0, User: "joe"}, }, ) - } diff --git a/smoketest/graphqlschedulefavorites_test.go b/test/smoketest/graphqlschedulefavorites_test.go similarity index 97% rename from smoketest/graphqlschedulefavorites_test.go rename to test/smoketest/graphqlschedulefavorites_test.go index 88e8663dad..5844bf2e5d 100644 --- a/smoketest/graphqlschedulefavorites_test.go +++ b/test/smoketest/graphqlschedulefavorites_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestGraphQLScheduleFavorites tests that schedules can be set and unset as user favorites @@ -100,5 +100,4 @@ func TestGraphQLScheduleFavorites(t *testing.T) { if s.Schedule.IsUserFav != false { t.Fatalf("ERROR: ScheduleID %s IsUserFavorite=%t; want false", h.UUID("schedId"), s.Schedule.IsUserFav) } - } diff --git a/smoketest/graphqlservicelabels_test.go b/test/smoketest/graphqlservicelabels_test.go similarity index 96% rename from smoketest/graphqlservicelabels_test.go rename to test/smoketest/graphqlservicelabels_test.go index 24fbf4c4ce..e55809f7d5 100644 --- a/smoketest/graphqlservicelabels_test.go +++ b/test/smoketest/graphqlservicelabels_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestGraphQLServiceLabels tests that labels for services can be created @@ -55,5 +55,4 @@ func TestGraphQLServiceLabels(t *testing.T) { setLabel(input:{ target: {type: service , id: "%s"}, key: "%s", value: "%s" }) } `, h.UUID("sid"), "foo/bar", "")) - } diff --git a/smoketest/graphqlupdaterotation_test.go b/test/smoketest/graphqlupdaterotation_test.go similarity index 98% rename from smoketest/graphqlupdaterotation_test.go rename to test/smoketest/graphqlupdaterotation_test.go index 9f895ed4c5..466cc5a422 100644 --- a/smoketest/graphqlupdaterotation_test.go +++ b/test/smoketest/graphqlupdaterotation_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestGraphQLUpdateRotation tests that all steps like creating and updating rotations are carried out without any errors. diff --git a/smoketest/graphqluserfavorites_test.go b/test/smoketest/graphqluserfavorites_test.go similarity index 97% rename from smoketest/graphqluserfavorites_test.go rename to test/smoketest/graphqluserfavorites_test.go index 66bf3878f1..80f052abde 100644 --- a/smoketest/graphqluserfavorites_test.go +++ b/test/smoketest/graphqluserfavorites_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestGraphQLUserFavorites tests that services can be set and unset as user favorites @@ -125,5 +125,4 @@ func TestGraphQLUserFavorites(t *testing.T) { if s.Service.IsFavorite != false { t.Fatalf("ERROR: ServiceID %s IsUserFavorite=%t; want false", h.UUID("sid2"), s.Service.IsFavorite) } - } diff --git a/smoketest/graphqlusers_test.go b/test/smoketest/graphqlusers_test.go similarity index 97% rename from smoketest/graphqlusers_test.go rename to test/smoketest/graphqlusers_test.go index fd2ec18111..d8c05e7803 100644 --- a/smoketest/graphqlusers_test.go +++ b/test/smoketest/graphqlusers_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestGraphQLUsers tests most operations on users API via GraphQL endpoint. @@ -124,5 +124,4 @@ func TestGraphQLUsers(t *testing.T) { // 3 because the 'GraphQL User' will be implicitly added. t.Errorf("got %d users; want 3", len(res.Users.Nodes)) } - } diff --git a/smoketest/harness/backend.go b/test/smoketest/harness/backend.go similarity index 100% rename from smoketest/harness/backend.go rename to test/smoketest/harness/backend.go diff --git a/smoketest/harness/datagen.go b/test/smoketest/harness/datagen.go similarity index 100% rename from smoketest/harness/datagen.go rename to test/smoketest/harness/datagen.go diff --git a/smoketest/harness/email.go b/test/smoketest/harness/email.go similarity index 100% rename from smoketest/harness/email.go rename to test/smoketest/harness/email.go diff --git a/smoketest/harness/graphql.go b/test/smoketest/harness/graphql.go similarity index 100% rename from smoketest/harness/graphql.go rename to test/smoketest/harness/graphql.go diff --git a/smoketest/harness/harness.go b/test/smoketest/harness/harness.go similarity index 100% rename from smoketest/harness/harness.go rename to test/smoketest/harness/harness.go diff --git a/smoketest/harness/matchers.go b/test/smoketest/harness/matchers.go similarity index 100% rename from smoketest/harness/matchers.go rename to test/smoketest/harness/matchers.go diff --git a/smoketest/harness/phoneassertions.go b/test/smoketest/harness/phoneassertions.go similarity index 100% rename from smoketest/harness/phoneassertions.go rename to test/smoketest/harness/phoneassertions.go diff --git a/smoketest/harness/slack.go b/test/smoketest/harness/slack.go similarity index 100% rename from smoketest/harness/slack.go rename to test/smoketest/harness/slack.go diff --git a/smoketest/harness/sql.go b/test/smoketest/harness/sql.go similarity index 100% rename from smoketest/harness/sql.go rename to test/smoketest/harness/sql.go diff --git a/smoketest/harness/sql_test.go b/test/smoketest/harness/sql_test.go similarity index 100% rename from smoketest/harness/sql_test.go rename to test/smoketest/harness/sql_test.go diff --git a/smoketest/harness/twilioassertionapi.go b/test/smoketest/harness/twilioassertionapi.go similarity index 100% rename from smoketest/harness/twilioassertionapi.go rename to test/smoketest/harness/twilioassertionapi.go diff --git a/smoketest/harness/twilioassertiondevice.go b/test/smoketest/harness/twilioassertiondevice.go similarity index 100% rename from smoketest/harness/twilioassertiondevice.go rename to test/smoketest/harness/twilioassertiondevice.go diff --git a/smoketest/harness/twilioassertionsms.go b/test/smoketest/harness/twilioassertionsms.go similarity index 100% rename from smoketest/harness/twilioassertionsms.go rename to test/smoketest/harness/twilioassertionsms.go diff --git a/smoketest/harness/twilioassertionvoicecall.go b/test/smoketest/harness/twilioassertionvoicecall.go similarity index 100% rename from smoketest/harness/twilioassertionvoicecall.go rename to test/smoketest/harness/twilioassertionvoicecall.go diff --git a/smoketest/heartbeat_test.go b/test/smoketest/heartbeat_test.go similarity index 97% rename from smoketest/heartbeat_test.go rename to test/smoketest/heartbeat_test.go index 69eb73f1ec..41ca423f43 100644 --- a/smoketest/heartbeat_test.go +++ b/test/smoketest/heartbeat_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) func TestHeartbeat(t *testing.T) { diff --git a/smoketest/inprogress_test.go b/test/smoketest/inprogress_test.go similarity index 98% rename from smoketest/inprogress_test.go rename to test/smoketest/inprogress_test.go index 787683fd9c..531151663a 100644 --- a/smoketest/inprogress_test.go +++ b/test/smoketest/inprogress_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestInProgress ensures that sent and in-progress notifications for triggered alerts are honored through the migration. diff --git a/smoketest/listalerts_test.go b/test/smoketest/listalerts_test.go similarity index 96% rename from smoketest/listalerts_test.go rename to test/smoketest/listalerts_test.go index b5c9f4b765..7d26e92b64 100644 --- a/smoketest/listalerts_test.go +++ b/test/smoketest/listalerts_test.go @@ -5,7 +5,7 @@ import ( "strconv" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) func TestListAlerts(t *testing.T) { diff --git a/smoketest/mailgunalerts_test.go b/test/smoketest/mailgunalerts_test.go similarity index 98% rename from smoketest/mailgunalerts_test.go rename to test/smoketest/mailgunalerts_test.go index ebaaa5ed8b..cbb729c05b 100644 --- a/smoketest/mailgunalerts_test.go +++ b/test/smoketest/mailgunalerts_test.go @@ -12,7 +12,7 @@ import ( "time" "github.com/stretchr/testify/assert" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestMailgunAlerts tests that GoAlert responds and diff --git a/smoketest/manualescalationnotification_test.go b/test/smoketest/manualescalationnotification_test.go similarity index 97% rename from smoketest/manualescalationnotification_test.go rename to test/smoketest/manualescalationnotification_test.go index 3c6bc83564..a057b378b2 100644 --- a/smoketest/manualescalationnotification_test.go +++ b/test/smoketest/manualescalationnotification_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestManualEscalation ensures that second step notifications are sent out when an acknowledged alert is manually escalated. diff --git a/smoketest/manyalerts_test.go b/test/smoketest/manyalerts_test.go similarity index 97% rename from smoketest/manyalerts_test.go rename to test/smoketest/manyalerts_test.go index e1823f839c..faa01d18a8 100644 --- a/smoketest/manyalerts_test.go +++ b/test/smoketest/manyalerts_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestManyAlerts ensures repeated alert -> msg -> close sequences work properly as long as the delay between @@ -82,5 +82,4 @@ func TestManyAlerts(t *testing.T) { for i := 0; i < 8; i++ { createAndClose(i) } - } diff --git a/smoketest/messagebundlesms_test.go b/test/smoketest/messagebundlesms_test.go similarity index 97% rename from smoketest/messagebundlesms_test.go rename to test/smoketest/messagebundlesms_test.go index a4c16f5081..3049ecb389 100644 --- a/smoketest/messagebundlesms_test.go +++ b/test/smoketest/messagebundlesms_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestMessageBundle_SMS checks that SMS status updates and alert notifications are bundled when General.MessageBundles is enabled. diff --git a/smoketest/messagebundlevoice_test.go b/test/smoketest/messagebundlevoice_test.go similarity index 97% rename from smoketest/messagebundlevoice_test.go rename to test/smoketest/messagebundlevoice_test.go index 3f604259bf..baff2f6844 100644 --- a/smoketest/messagebundlevoice_test.go +++ b/test/smoketest/messagebundlevoice_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestMessageBundle_Voice checks that SMS status updates and alert notifications are bundled when General.MessageBundles is enabled. diff --git a/smoketest/migrations_test.go b/test/smoketest/migrations_test.go similarity index 99% rename from smoketest/migrations_test.go rename to test/smoketest/migrations_test.go index db026aa4c6..0f439c3fc6 100644 --- a/smoketest/migrations_test.go +++ b/test/smoketest/migrations_test.go @@ -19,7 +19,7 @@ import ( "github.com/google/uuid" _ "github.com/jackc/pgx/v4/stdlib" // import db driver "github.com/target/goalert/migrate" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" "github.com/target/goalert/util/sqlutil" ) diff --git a/smoketest/missinguser_test.go b/test/smoketest/missinguser_test.go similarity index 98% rename from smoketest/missinguser_test.go rename to test/smoketest/missinguser_test.go index 0e10c3b807..e67fe71f4f 100644 --- a/smoketest/missinguser_test.go +++ b/test/smoketest/missinguser_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestMissingUser tests that notifications go out, even when data is in an odd state. diff --git a/smoketest/multistepnotification_test.go b/test/smoketest/multistepnotification_test.go similarity index 96% rename from smoketest/multistepnotification_test.go rename to test/smoketest/multistepnotification_test.go index bb592e69c9..cf3900765d 100644 --- a/smoketest/multistepnotification_test.go +++ b/test/smoketest/multistepnotification_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestMultiStepNotifications tests that SMS and Voice goes out for @@ -57,5 +57,4 @@ func TestMultiStepNotifications(t *testing.T) { h.FastForward(30 * time.Minute) d1.ExpectSMS("testing") - } diff --git a/smoketest/multiuser_test.go b/test/smoketest/multiuser_test.go similarity index 97% rename from smoketest/multiuser_test.go rename to test/smoketest/multiuser_test.go index d3b626d6a1..3991946ef3 100644 --- a/smoketest/multiuser_test.go +++ b/test/smoketest/multiuser_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestMultiUser checks that if multiple users are assigned to a policy step, diff --git a/smoketest/oncallnotify_test.go b/test/smoketest/oncallnotify_test.go similarity index 97% rename from smoketest/oncallnotify_test.go rename to test/smoketest/oncallnotify_test.go index 2ce6f59762..36c6ad6f27 100644 --- a/smoketest/oncallnotify_test.go +++ b/test/smoketest/oncallnotify_test.go @@ -10,7 +10,7 @@ import ( "github.com/target/goalert/assignment" "github.com/target/goalert/permission" "github.com/target/goalert/schedule/rule" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" "github.com/target/goalert/util/timeutil" ) diff --git a/smoketest/oncallnotifytod_test.go b/test/smoketest/oncallnotifytod_test.go similarity index 96% rename from smoketest/oncallnotifytod_test.go rename to test/smoketest/oncallnotifytod_test.go index 7787379493..2ebc1c9f9c 100644 --- a/smoketest/oncallnotifytod_test.go +++ b/test/smoketest/oncallnotifytod_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestOnCallNotifyTOD will test that time-of-day on-call notifications work. diff --git a/smoketest/overrideconflict_test.go b/test/smoketest/overrideconflict_test.go similarity index 96% rename from smoketest/overrideconflict_test.go rename to test/smoketest/overrideconflict_test.go index 6e744cc632..c67a73c6f9 100644 --- a/smoketest/overrideconflict_test.go +++ b/test/smoketest/overrideconflict_test.go @@ -9,7 +9,7 @@ import ( "github.com/target/goalert/assignment" "github.com/target/goalert/override" "github.com/target/goalert/permission" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) func TestOverrideConflict(t *testing.T) { diff --git a/smoketest/policyreassignment_test.go b/test/smoketest/policyreassignment_test.go similarity index 97% rename from smoketest/policyreassignment_test.go rename to test/smoketest/policyreassignment_test.go index d17346759b..1fe56525fa 100644 --- a/smoketest/policyreassignment_test.go +++ b/test/smoketest/policyreassignment_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestPolicyReassignment tests that only the active escalation policy is used for alerts. diff --git a/smoketest/postcyclerules_test.go b/test/smoketest/postcyclerules_test.go similarity index 96% rename from smoketest/postcyclerules_test.go rename to test/smoketest/postcyclerules_test.go index 32d46a8ae5..acebd031fe 100644 --- a/smoketest/postcyclerules_test.go +++ b/test/smoketest/postcyclerules_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestPostCycleRules checks that new rules added after the last diff --git a/smoketest/prioritization_test.go b/test/smoketest/prioritization_test.go similarity index 97% rename from smoketest/prioritization_test.go rename to test/smoketest/prioritization_test.go index 811d8dc012..87de15578f 100644 --- a/smoketest/prioritization_test.go +++ b/test/smoketest/prioritization_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestPrioritization tests that notifications for new users/alerts get diff --git a/smoketest/prometheusalertmanager_test.go b/test/smoketest/prometheusalertmanager_test.go similarity index 97% rename from smoketest/prometheusalertmanager_test.go rename to test/smoketest/prometheusalertmanager_test.go index 27a974d76b..1910ffec7c 100644 --- a/smoketest/prometheusalertmanager_test.go +++ b/test/smoketest/prometheusalertmanager_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) func TestPrometheusAlertManager(t *testing.T) { diff --git a/smoketest/rotationdaily_test.go b/test/smoketest/rotationdaily_test.go similarity index 97% rename from smoketest/rotationdaily_test.go rename to test/smoketest/rotationdaily_test.go index 80735c95bf..beeada6c11 100644 --- a/smoketest/rotationdaily_test.go +++ b/test/smoketest/rotationdaily_test.go @@ -1,9 +1,10 @@ package smoketest import ( - "github.com/target/goalert/smoketest/harness" "testing" "time" + + "github.com/target/goalert/test/smoketest/harness" ) func TestRotation_Daily(t *testing.T) { diff --git a/smoketest/rotationdeluser_test.go b/test/smoketest/rotationdeluser_test.go similarity index 96% rename from smoketest/rotationdeluser_test.go rename to test/smoketest/rotationdeluser_test.go index f467b7238d..ae8aebcb37 100644 --- a/smoketest/rotationdeluser_test.go +++ b/test/smoketest/rotationdeluser_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // RotationDelUser tests that rotations preserve the active user when a user is deleted. diff --git a/smoketest/rotationdst_test.go b/test/smoketest/rotationdst_test.go similarity index 97% rename from smoketest/rotationdst_test.go rename to test/smoketest/rotationdst_test.go index 48ec5541d4..533669119c 100644 --- a/smoketest/rotationdst_test.go +++ b/test/smoketest/rotationdst_test.go @@ -1,9 +1,10 @@ package smoketest import ( - "github.com/target/goalert/smoketest/harness" "testing" "time" + + "github.com/target/goalert/test/smoketest/harness" ) func getLastDSTDate(t *testing.T, n time.Time, loc *time.Location) time.Time { @@ -21,7 +22,6 @@ func getLastDSTDate(t *testing.T, n time.Time, loc *time.Location) time.Time { n = n.AddDate(0, -1, 0) _, offset = n.Zone() } - } return n diff --git a/smoketest/rotationgap_test.go b/test/smoketest/rotationgap_test.go similarity index 96% rename from smoketest/rotationgap_test.go rename to test/smoketest/rotationgap_test.go index 0c39499f55..0c8026bc67 100644 --- a/smoketest/rotationgap_test.go +++ b/test/smoketest/rotationgap_test.go @@ -1,8 +1,9 @@ package smoketest import ( - "github.com/target/goalert/smoketest/harness" "testing" + + "github.com/target/goalert/test/smoketest/harness" ) func TestRotationGap(t *testing.T) { diff --git a/smoketest/rotationhourly_test.go b/test/smoketest/rotationhourly_test.go similarity index 97% rename from smoketest/rotationhourly_test.go rename to test/smoketest/rotationhourly_test.go index 752761e271..3467aa9853 100644 --- a/smoketest/rotationhourly_test.go +++ b/test/smoketest/rotationhourly_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) func TestRotation_Hourly(t *testing.T) { @@ -73,5 +73,4 @@ func TestRotation_Hourly(t *testing.T) { uid2 := h.UUID("uid2") h.WaitAndAssertOnCallUsers(sid, uid2) - } diff --git a/smoketest/rotationweekly_test.go b/test/smoketest/rotationweekly_test.go similarity index 97% rename from smoketest/rotationweekly_test.go rename to test/smoketest/rotationweekly_test.go index b9c7e5b9f0..21ebe4ed0f 100644 --- a/smoketest/rotationweekly_test.go +++ b/test/smoketest/rotationweekly_test.go @@ -1,9 +1,10 @@ package smoketest import ( - "github.com/target/goalert/smoketest/harness" "testing" "time" + + "github.com/target/goalert/test/smoketest/harness" ) func TestRotation_Weekly(t *testing.T) { diff --git a/smoketest/rotationwrap_test.go b/test/smoketest/rotationwrap_test.go similarity index 97% rename from smoketest/rotationwrap_test.go rename to test/smoketest/rotationwrap_test.go index e476199f99..a576504501 100644 --- a/smoketest/rotationwrap_test.go +++ b/test/smoketest/rotationwrap_test.go @@ -1,9 +1,10 @@ package smoketest import ( - "github.com/target/goalert/smoketest/harness" "testing" "time" + + "github.com/target/goalert/test/smoketest/harness" ) // TestRotation_Wrap checks that rotations wrap & repeat @@ -70,5 +71,4 @@ func TestRotation_Wrap(t *testing.T) { h.FastForward(20 * time.Minute) h.WaitAndAssertOnCallUsers(sid, uid1) - } diff --git a/smoketest/schedulerule_test.go b/test/smoketest/schedulerule_test.go similarity index 97% rename from smoketest/schedulerule_test.go rename to test/smoketest/schedulerule_test.go index 70b689846b..2c882b0ad1 100644 --- a/smoketest/schedulerule_test.go +++ b/test/smoketest/schedulerule_test.go @@ -1,9 +1,10 @@ package smoketest import ( - "github.com/target/goalert/smoketest/harness" "testing" "time" + + "github.com/target/goalert/test/smoketest/harness" ) // TestScheduleRule performs the following checks: diff --git a/smoketest/servicemaintenancealert_test.go b/test/smoketest/servicemaintenancealert_test.go similarity index 97% rename from smoketest/servicemaintenancealert_test.go rename to test/smoketest/servicemaintenancealert_test.go index 986ed3397e..5d4df18b7d 100644 --- a/smoketest/servicemaintenancealert_test.go +++ b/test/smoketest/servicemaintenancealert_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestServiceMaintenanceAlert tests that an alert created for a user before diff --git a/smoketest/servicemaintenanceescalate_test.go b/test/smoketest/servicemaintenanceescalate_test.go similarity index 97% rename from smoketest/servicemaintenanceescalate_test.go rename to test/smoketest/servicemaintenanceescalate_test.go index 9c0f9864e0..c9096962bc 100644 --- a/smoketest/servicemaintenanceescalate_test.go +++ b/test/smoketest/servicemaintenanceescalate_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestServiceMaintenanceEscalate tests creating and attempting diff --git a/smoketest/simplenotification_test.go b/test/smoketest/simplenotification_test.go similarity index 98% rename from smoketest/simplenotification_test.go rename to test/smoketest/simplenotification_test.go index 9cf8cdf4b6..da69f164f0 100644 --- a/smoketest/simplenotification_test.go +++ b/test/smoketest/simplenotification_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestSimpleNotifications tests that SMS and Voice goes out for diff --git a/smoketest/site24x7_test.go b/test/smoketest/site24x7_test.go similarity index 97% rename from smoketest/site24x7_test.go rename to test/smoketest/site24x7_test.go index 6ab4a1ccdf..4de0cb84a8 100644 --- a/smoketest/site24x7_test.go +++ b/test/smoketest/site24x7_test.go @@ -5,7 +5,7 @@ import ( "net/http" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) func TestSite24x7(t *testing.T) { diff --git a/smoketest/slackaddtoepstep_test.go b/test/smoketest/slackaddtoepstep_test.go similarity index 95% rename from smoketest/slackaddtoepstep_test.go rename to test/smoketest/slackaddtoepstep_test.go index f7aeb1f26f..564ecc8a7c 100644 --- a/smoketest/slackaddtoepstep_test.go +++ b/test/smoketest/slackaddtoepstep_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestSlackAddToEPStep tests that slack channels can be added to an EPStep. @@ -54,5 +54,4 @@ func TestSlackAddToEPStep(t *testing.T) { h.CreateAlert(h.UUID("sid"), "testing") channel.ExpectMessage("testing") - } diff --git a/smoketest/slackchannels_test.go b/test/smoketest/slackchannels_test.go similarity index 96% rename from smoketest/slackchannels_test.go rename to test/smoketest/slackchannels_test.go index 2865f35437..e72d118667 100644 --- a/smoketest/slackchannels_test.go +++ b/test/smoketest/slackchannels_test.go @@ -2,9 +2,10 @@ package smoketest import ( "encoding/json" - "github.com/target/goalert/smoketest/harness" "sort" "testing" + + "github.com/target/goalert/test/smoketest/harness" ) // TestSlackChannels tests that slack channels are returned for configured users. diff --git a/smoketest/slackinteraction_test.go b/test/smoketest/slackinteraction_test.go similarity index 97% rename from smoketest/slackinteraction_test.go rename to test/smoketest/slackinteraction_test.go index cccf3950cc..0fca5c5c81 100644 --- a/smoketest/slackinteraction_test.go +++ b/test/smoketest/slackinteraction_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestSlackInteraction checks that interactive slack messages work properly. diff --git a/smoketest/slacknotification_test.go b/test/smoketest/slacknotification_test.go similarity index 95% rename from smoketest/slacknotification_test.go rename to test/smoketest/slacknotification_test.go index 5954a61da1..8eab44fc22 100644 --- a/smoketest/slacknotification_test.go +++ b/test/smoketest/slacknotification_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestSlackNotification tests that slack channels are returned for configured users. diff --git a/smoketest/statusinprogress_test.go b/test/smoketest/statusinprogress_test.go similarity index 97% rename from smoketest/statusinprogress_test.go rename to test/smoketest/statusinprogress_test.go index 56507520c8..def67b292e 100644 --- a/smoketest/statusinprogress_test.go +++ b/test/smoketest/statusinprogress_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestStatusInProgress ensures that sent and in-progress notifications for triggered alerts are honored through the migration. diff --git a/smoketest/statusupdates_test.go b/test/smoketest/statusupdates_test.go similarity index 98% rename from smoketest/statusupdates_test.go rename to test/smoketest/statusupdates_test.go index 7bb339393a..6fdbd36361 100644 --- a/smoketest/statusupdates_test.go +++ b/test/smoketest/statusupdates_test.go @@ -6,7 +6,7 @@ import ( "net/url" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestStatusUpdates checks basic functionality of status updates: diff --git a/smoketest/statusupdatescancel_test.go b/test/smoketest/statusupdatescancel_test.go similarity index 98% rename from smoketest/statusupdatescancel_test.go rename to test/smoketest/statusupdatescancel_test.go index 01a44ead79..606849f7b6 100644 --- a/smoketest/statusupdatescancel_test.go +++ b/test/smoketest/statusupdatescancel_test.go @@ -7,7 +7,7 @@ import ( "net/url" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestStatusUpdatesCancel checks that status updates are unsubscribed when updates, or the contact method, are disabled. @@ -92,5 +92,4 @@ func TestStatusUpdatesCancel(t *testing.T) { doClose("second") // contact method was canceled, so no status updates should be sent. - } diff --git a/smoketest/statusupdateschannel_test.go b/test/smoketest/statusupdateschannel_test.go similarity index 96% rename from smoketest/statusupdateschannel_test.go rename to test/smoketest/statusupdateschannel_test.go index 20f66d0da8..8b768e164e 100644 --- a/smoketest/statusupdateschannel_test.go +++ b/test/smoketest/statusupdateschannel_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestStatusUpdatesChannel tests status updates to notification channels. diff --git a/smoketest/switchover_test.go b/test/smoketest/switchover_test.go similarity index 89% rename from smoketest/switchover_test.go rename to test/smoketest/switchover_test.go index c2238d3e3d..d60d31689c 100644 --- a/smoketest/switchover_test.go +++ b/test/smoketest/switchover_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/smoketest/harness" "github.com/target/goalert/switchover/dbsync" + "github.com/target/goalert/test/smoketest/harness" ) // TestDBSyncTables ensures the latest state of the database is compatible with the dbsync package. diff --git a/smoketest/systemlimits_test.go b/test/smoketest/systemlimits_test.go similarity index 99% rename from smoketest/systemlimits_test.go rename to test/smoketest/systemlimits_test.go index df94cdd8c5..7f580b277b 100644 --- a/smoketest/systemlimits_test.go +++ b/test/smoketest/systemlimits_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/target/goalert/limit" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestSystemLimits tests that limits are enforced if configured. @@ -373,5 +373,4 @@ func TestSystemLimits(t *testing.T) { return fmt.Sprintf(`mutation{deleteAll(input:[{type: calendarSubscription, id: "%s"}])}`, ids[0]) }, ) - } diff --git a/smoketest/tempschedules_test.go b/test/smoketest/tempschedules_test.go similarity index 98% rename from smoketest/tempschedules_test.go rename to test/smoketest/tempschedules_test.go index 781012316b..9fd655b01b 100644 --- a/smoketest/tempschedules_test.go +++ b/test/smoketest/tempschedules_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) func TestTempSchedules(t *testing.T) { diff --git a/smoketest/twilioenablebysms_test.go b/test/smoketest/twilioenablebysms_test.go similarity index 97% rename from smoketest/twilioenablebysms_test.go rename to test/smoketest/twilioenablebysms_test.go index df1b1db2b4..874b4473aa 100644 --- a/smoketest/twilioenablebysms_test.go +++ b/test/smoketest/twilioenablebysms_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioEnableBySMS checks that all contact methods with the same value and of the same user are enabled when the user responds via SMS with the correct code. diff --git a/smoketest/twilioenablebyvoice_test.go b/test/smoketest/twilioenablebyvoice_test.go similarity index 97% rename from smoketest/twilioenablebyvoice_test.go rename to test/smoketest/twilioenablebyvoice_test.go index 843fb128cc..7505cb84a8 100644 --- a/smoketest/twilioenablebyvoice_test.go +++ b/test/smoketest/twilioenablebyvoice_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioEnablebyVoice checks that all contact methods with the same value and of the same user are enabled when the user responds via Voice with the correct code. diff --git a/smoketest/twilioonewaysms_test.go b/test/smoketest/twilioonewaysms_test.go similarity index 96% rename from smoketest/twilioonewaysms_test.go rename to test/smoketest/twilioonewaysms_test.go index 3f5c830b91..8a8e828d16 100644 --- a/smoketest/twilioonewaysms_test.go +++ b/test/smoketest/twilioonewaysms_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioOneWaySMS checks that two-way SMS can be disabled via config. diff --git a/smoketest/twiliosid_test.go b/test/smoketest/twiliosid_test.go similarity index 97% rename from smoketest/twiliosid_test.go rename to test/smoketest/twiliosid_test.go index f4d57f7420..578c5c887f 100644 --- a/smoketest/twiliosid_test.go +++ b/test/smoketest/twiliosid_test.go @@ -5,7 +5,7 @@ import ( "time" "github.com/stretchr/testify/assert" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioSID checks that messages to SMS and Voice numbers work when using a Messaging Service SID for Twilio.FromNumber. diff --git a/smoketest/twiliosmsack_test.go b/test/smoketest/twiliosmsack_test.go similarity index 96% rename from smoketest/twiliosmsack_test.go rename to test/smoketest/twiliosmsack_test.go index 14a2e61201..dd53b4e917 100644 --- a/smoketest/twiliosmsack_test.go +++ b/test/smoketest/twiliosmsack_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioSMSAck checks that an SMS ack message is processed. diff --git a/smoketest/twiliosmsclose_test.go b/test/smoketest/twiliosmsclose_test.go similarity index 96% rename from smoketest/twiliosmsclose_test.go rename to test/smoketest/twiliosmsclose_test.go index 68d144f4e5..15f00c8fb1 100644 --- a/smoketest/twiliosmsclose_test.go +++ b/test/smoketest/twiliosmsclose_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioSMSClose checks that an SMS close message is processed. diff --git a/smoketest/twiliosmsfailure_test.go b/test/smoketest/twiliosmsfailure_test.go similarity index 96% rename from smoketest/twiliosmsfailure_test.go rename to test/smoketest/twiliosmsfailure_test.go index cd5835e7b4..22b5d103e1 100644 --- a/smoketest/twiliosmsfailure_test.go +++ b/test/smoketest/twiliosmsfailure_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioSMSFailure checks that an SMS delivery failure is retried. diff --git a/smoketest/twiliosmsfromoverride_test.go b/test/smoketest/twiliosmsfromoverride_test.go similarity index 97% rename from smoketest/twiliosmsfromoverride_test.go rename to test/smoketest/twiliosmsfromoverride_test.go index a79a69d9d4..bd31aa4e3f 100644 --- a/smoketest/twiliosmsfromoverride_test.go +++ b/test/smoketest/twiliosmsfromoverride_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioSMSFromOverride checks that the FromNumber of an SMS can be overridden per-carrier. @@ -56,5 +56,4 @@ func TestTwilioSMSFromOverride(t *testing.T) { sms2 := tw.Device(h.Phone("2")).ExpectSMS("testing") assert.Equal(t, altFrom, sms2.From(), "overridden carrier from number") - } diff --git a/smoketest/twiliosmsreplycode_test.go b/test/smoketest/twiliosmsreplycode_test.go similarity index 96% rename from smoketest/twiliosmsreplycode_test.go rename to test/smoketest/twiliosmsreplycode_test.go index 04661aa8cb..bebe8cce05 100644 --- a/smoketest/twiliosmsreplycode_test.go +++ b/test/smoketest/twiliosmsreplycode_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioSMSReplyCode checks that reply codes work properly. diff --git a/smoketest/twiliosmsreplyignore_test.go b/test/smoketest/twiliosmsreplyignore_test.go similarity index 94% rename from smoketest/twiliosmsreplyignore_test.go rename to test/smoketest/twiliosmsreplyignore_test.go index d2c29a162b..793aacd516 100644 --- a/smoketest/twiliosmsreplyignore_test.go +++ b/test/smoketest/twiliosmsreplyignore_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioSMSReplyIgnore checks that replies are dropped/ignored for unknown/disabled contact methods. @@ -36,5 +36,4 @@ func TestTwilioSMSReplyIgnore(t *testing.T) { // d2 should not get a message, as it's disabled // d3 should not get a message, as it's unknown - } diff --git a/smoketest/twiliosmsreplylast_test.go b/test/smoketest/twiliosmsreplylast_test.go similarity index 96% rename from smoketest/twiliosmsreplylast_test.go rename to test/smoketest/twiliosmsreplylast_test.go index 0ea76762b0..b6e3cc951a 100644 --- a/smoketest/twiliosmsreplylast_test.go +++ b/test/smoketest/twiliosmsreplylast_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioSMSReplyLast checks that an SMS reply message is processed with no number. diff --git a/smoketest/twiliosmsreplylimit_test.go b/test/smoketest/twiliosmsreplylimit_test.go similarity index 96% rename from smoketest/twiliosmsreplylimit_test.go rename to test/smoketest/twiliosmsreplylimit_test.go index 553747e676..8b1ca69c97 100644 --- a/smoketest/twiliosmsreplylimit_test.go +++ b/test/smoketest/twiliosmsreplylimit_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioSMSReplyLimit checks for a limit on passive replies (no action was taken due to error or already closed, etc). @@ -61,5 +61,4 @@ func TestTwilioSMSReplyLimit(t *testing.T) { // should reset after ack d1.SendSMS("nonsense") d1.ExpectSMS("sorry") - } diff --git a/smoketest/twiliosmsstopstart_test.go b/test/smoketest/twiliosmsstopstart_test.go similarity index 97% rename from smoketest/twiliosmsstopstart_test.go rename to test/smoketest/twiliosmsstopstart_test.go index d9b6347315..9ce29ec749 100644 --- a/smoketest/twiliosmsstopstart_test.go +++ b/test/smoketest/twiliosmsstopstart_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioSMSStopStart checks that SMS STOP and START messages are processed. diff --git a/smoketest/twiliosmstrailingspace_test.go b/test/smoketest/twiliosmstrailingspace_test.go similarity index 96% rename from smoketest/twiliosmstrailingspace_test.go rename to test/smoketest/twiliosmstrailingspace_test.go index 2c426e6c99..13a6b2ba01 100644 --- a/smoketest/twiliosmstrailingspace_test.go +++ b/test/smoketest/twiliosmstrailingspace_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioSMSTrailingSpace checks that an SMS ack message is processed even with trailing spaces in response. diff --git a/smoketest/twiliosmsurl_test.go b/test/smoketest/twiliosmsurl_test.go similarity index 98% rename from smoketest/twiliosmsurl_test.go rename to test/smoketest/twiliosmsurl_test.go index 37cd1972a3..79326a5f33 100644 --- a/smoketest/twiliosmsurl_test.go +++ b/test/smoketest/twiliosmsurl_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioURL_SMS checks that the GoAlert link in the SMS is correct @@ -55,7 +55,6 @@ func TestTwilioURL_SMS(t *testing.T) { h.CreateAlert(h.UUID("sid"), "test") d1.ExpectSMS("test", longURL) - }) t.Run("General.ShortURL in sms body", func(t *testing.T) { @@ -70,7 +69,6 @@ func TestTwilioURL_SMS(t *testing.T) { h.CreateAlert(h.UUID("sid"), "test") d1.ExpectSMS("test", shortURL) - }) t.Run("General.DisableSMSLinks with General.ShortURL set", func(t *testing.T) { diff --git a/smoketest/twiliosmsverification_test.go b/test/smoketest/twiliosmsverification_test.go similarity index 96% rename from smoketest/twiliosmsverification_test.go rename to test/smoketest/twiliosmsverification_test.go index 76967aee7d..4d894e34cb 100644 --- a/smoketest/twiliosmsverification_test.go +++ b/test/smoketest/twiliosmsverification_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioSMSVerification checks that a verification SMS is processed. diff --git a/smoketest/twiliotestsms_test.go b/test/smoketest/twiliotestsms_test.go similarity index 94% rename from smoketest/twiliotestsms_test.go rename to test/smoketest/twiliotestsms_test.go index 4eeb4e1b82..4f82f3647b 100644 --- a/smoketest/twiliotestsms_test.go +++ b/test/smoketest/twiliotestsms_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioSMS checks that a test SMS is processed. diff --git a/smoketest/twiliotestvoice_test.go b/test/smoketest/twiliotestvoice_test.go similarity index 94% rename from smoketest/twiliotestvoice_test.go rename to test/smoketest/twiliotestvoice_test.go index c664d19eeb..013e89c5d3 100644 --- a/smoketest/twiliotestvoice_test.go +++ b/test/smoketest/twiliotestvoice_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioVoice checks that a test voice call is processed. diff --git a/smoketest/twiliovoiceack_test.go b/test/smoketest/twiliovoiceack_test.go similarity index 96% rename from smoketest/twiliovoiceack_test.go rename to test/smoketest/twiliovoiceack_test.go index 5395f8d16e..c795b7f825 100644 --- a/smoketest/twiliovoiceack_test.go +++ b/test/smoketest/twiliovoiceack_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioVoiceAck checks that a voice call ack is processed. diff --git a/smoketest/twiliovoiceclose_test.go b/test/smoketest/twiliovoiceclose_test.go similarity index 96% rename from smoketest/twiliovoiceclose_test.go rename to test/smoketest/twiliovoiceclose_test.go index 99378dfb26..c4f5bfda74 100644 --- a/smoketest/twiliovoiceclose_test.go +++ b/test/smoketest/twiliovoiceclose_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioVoiceClose checks that a voice call close is processed. diff --git a/smoketest/twiliovoiceemptymessage_test.go b/test/smoketest/twiliovoiceemptymessage_test.go similarity index 96% rename from smoketest/twiliovoiceemptymessage_test.go rename to test/smoketest/twiliovoiceemptymessage_test.go index f64403e685..622f4648c5 100644 --- a/smoketest/twiliovoiceemptymessage_test.go +++ b/test/smoketest/twiliovoiceemptymessage_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioVoiceEmptyMessage checks that an appropriate voice call is made when alert has empty summary. diff --git a/smoketest/twiliovoicefailure_test.go b/test/smoketest/twiliovoicefailure_test.go similarity index 95% rename from smoketest/twiliovoicefailure_test.go rename to test/smoketest/twiliovoicefailure_test.go index bbcc93c39f..620e011be3 100644 --- a/smoketest/twiliovoicefailure_test.go +++ b/test/smoketest/twiliovoicefailure_test.go @@ -3,7 +3,7 @@ package smoketest import ( "testing" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioVoiceFailure checks that a voice call failure is retried. diff --git a/smoketest/twiliovoicestop_test.go b/test/smoketest/twiliovoicestop_test.go similarity index 96% rename from smoketest/twiliovoicestop_test.go rename to test/smoketest/twiliovoicestop_test.go index 0c76ca646f..ec8b43e5d9 100644 --- a/smoketest/twiliovoicestop_test.go +++ b/test/smoketest/twiliovoicestop_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioVoiceStop checks that a voice call STOP is processed. diff --git a/smoketest/twiliovoiceverification_test.go b/test/smoketest/twiliovoiceverification_test.go similarity index 97% rename from smoketest/twiliovoiceverification_test.go rename to test/smoketest/twiliovoiceverification_test.go index 4871c0a83b..576d8d6f18 100644 --- a/smoketest/twiliovoiceverification_test.go +++ b/test/smoketest/twiliovoiceverification_test.go @@ -8,7 +8,7 @@ import ( "time" "github.com/stretchr/testify/assert" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) // TestTwilioVoiceVerification checks that a verification voice call is processed. diff --git a/smoketest/upload.sh b/test/smoketest/upload.sh similarity index 93% rename from smoketest/upload.sh rename to test/smoketest/upload.sh index fffb65699e..c2125be4df 100755 --- a/smoketest/upload.sh +++ b/test/smoketest/upload.sh @@ -18,7 +18,7 @@ then echo "" for name in $FAILURES do - fname="smoketest/smoketest_db_dump/$NAME.sql" + fname="test/smoketest/smoketest_db_dump/$NAME.sql" if [ -e "$fname" ] then FILE=$(curl -LksS "$SERVER/sql/" --data-binary "@$fname" -H "Authorization: Bearer $BUILD_IMAGE_SERVICE_TOKEN") diff --git a/smoketest/webhook_test.go b/test/smoketest/webhook_test.go similarity index 97% rename from smoketest/webhook_test.go rename to test/smoketest/webhook_test.go index eac5731d14..a284febf82 100644 --- a/smoketest/webhook_test.go +++ b/test/smoketest/webhook_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/target/goalert/smoketest/harness" + "github.com/target/goalert/test/smoketest/harness" ) type WebhookTestingAlert struct { diff --git a/web/src/.gitignore b/web/src/.gitignore index 1f4299964e..8a636018ee 100644 --- a/web/src/.gitignore +++ b/web/src/.gitignore @@ -1,7 +1,6 @@ node_modules __generated__ .idea/ -/smoketest/output bundle.js npm-debug.log build/ From 69b2440765a055a1d2210fac873e8191232d32f8 Mon Sep 17 00:00:00 2001 From: Nathaniel Caza Date: Wed, 24 Aug 2022 12:13:16 -0500 Subject: [PATCH 2/4] add testing section to contributing --- CONTRIBUTING.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fd2a3016b5..7757ae99d3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,3 +37,13 @@ Be sure to run `make check` and tests before opening a PR to catch common errors - Use unit tests as a tool to validate complex logic. For [example](./schedule/rule/weekdayfilter_test.go). - New functionality should have a behavioral smoketest at a minimum. For [example](./test/smoketest/simplenotification_test.go). Documentation on our smoketest framework can be found [here](./test/smoketest/README.md). - Go code should [follow best practices](https://golang.org/doc/effective_go.html), exported functions/methods should be commented, etc.. + +## Testing + +GoAlert utilizes 3 main types of testing as tools for different purposes: + +- Unit tests are used for complicated logic and exhaustive edge-case testing and benchmarking. They live with the code being tested: + - For backend code, a `_test.go` version of a file will contain relevant unit tests. More info [here](https://pkg.go.dev/testing) + - For UI code, a `.test.ts` version of a file will contain relevant unit tests. More info [here](https://jestjs.io/docs/getting-started). +- Smoke tests (in `test/smoke`) are used to ensure main functionality and things like behavioral compatibility with future versions & DB migrations. These focus on hard guarantees like deliverability and preserving intent as the application and datastore evolves and changes over time. +- Integration tests (currently under `web/src/cypress/integration`) are primarily used to validate happy-path flows work end-to-end, and any important/common error scenarios. They are focused on UX and high-level funcationality. From e7f1cf3807a4992433ed002eeb90c0062fff80cc Mon Sep 17 00:00:00 2001 From: Nathaniel Caza Date: Wed, 24 Aug 2022 12:21:24 -0500 Subject: [PATCH 3/4] smoketest -> smoke --- CONTRIBUTING.md | 2 +- Makefile | 10 ++++++++-- devtools/ci/tasks/scripts/build-all.sh | 2 +- devtools/ci/tasks/scripts/test-smoketest.sh | 4 ++-- devtools/psql-lite/main.go | 2 +- docs/development-setup.md | 8 ++++---- test/{smoketest => smoke}/README.md | 0 test/{smoketest => smoke}/addrules_test.go | 4 ++-- test/{smoketest => smoke}/alertcleanup_test.go | 4 ++-- test/{smoketest => smoke}/alertlog_test.go | 4 ++-- test/{smoketest => smoke}/calendarsubscription_test.go | 4 ++-- test/{smoketest => smoke}/cmtestdisable_test.go | 4 ++-- test/{smoketest => smoke}/dedupnotifications_test.go | 4 ++-- .../deleteescalationpolicy_test.go | 4 ++-- test/{smoketest => smoke}/deleterotation_test.go | 4 ++-- test/{smoketest => smoke}/emailnotification_test.go | 4 ++-- test/{smoketest => smoke}/escalation_test.go | 4 ++-- test/{smoketest => smoke}/escalationgap_test.go | 4 ++-- .../escalationnotification_test.go | 4 ++-- test/{smoketest => smoke}/genericapi_test.go | 4 ++-- test/{smoketest => smoke}/genericapiclose_test.go | 4 ++-- test/{smoketest => smoke}/genericapidedup_test.go | 4 ++-- test/{smoketest => smoke}/grafana_test.go | 4 ++-- test/{smoketest => smoke}/graphqlalert_test.go | 4 ++-- test/{smoketest => smoke}/graphqlalertlogs_test.go | 4 ++-- test/{smoketest => smoke}/graphqlalertsort_test.go | 4 ++-- .../graphqlcalendarsubscriptions_test.go | 4 ++-- .../{smoketest => smoke}/graphqlcreateschedule_test.go | 4 ++-- .../graphqlcreatescheduledefaultrotation_test.go | 4 ++-- .../graphqlfavoriterotations_test.go | 4 ++-- .../{smoketest => smoke}/graphqlmultiplealerts_test.go | 4 ++-- test/{smoketest => smoke}/graphqlnotices_test.go | 4 ++-- .../{smoketest => smoke}/graphqlnotifiedalerts_test.go | 4 ++-- test/{smoketest => smoke}/graphqloncall_test.go | 4 ++-- .../graphqloncallassignments_test.go | 4 ++-- .../graphqlschedulefavorites_test.go | 4 ++-- test/{smoketest => smoke}/graphqlservicelabels_test.go | 4 ++-- .../{smoketest => smoke}/graphqlupdaterotation_test.go | 4 ++-- test/{smoketest => smoke}/graphqluserfavorites_test.go | 4 ++-- test/{smoketest => smoke}/graphqlusers_test.go | 4 ++-- test/{smoketest => smoke}/harness/backend.go | 0 test/{smoketest => smoke}/harness/datagen.go | 0 test/{smoketest => smoke}/harness/email.go | 0 test/{smoketest => smoke}/harness/graphql.go | 0 test/{smoketest => smoke}/harness/harness.go | 0 test/{smoketest => smoke}/harness/matchers.go | 0 test/{smoketest => smoke}/harness/phoneassertions.go | 0 test/{smoketest => smoke}/harness/slack.go | 0 test/{smoketest => smoke}/harness/sql.go | 0 test/{smoketest => smoke}/harness/sql_test.go | 0 .../{smoketest => smoke}/harness/twilioassertionapi.go | 0 .../harness/twilioassertiondevice.go | 0 .../{smoketest => smoke}/harness/twilioassertionsms.go | 0 .../harness/twilioassertionvoicecall.go | 0 test/{smoketest => smoke}/heartbeat_test.go | 4 ++-- test/{smoketest => smoke}/inprogress_test.go | 4 ++-- test/{smoketest => smoke}/listalerts_test.go | 4 ++-- test/{smoketest => smoke}/mailgunalerts_test.go | 4 ++-- .../manualescalationnotification_test.go | 4 ++-- test/{smoketest => smoke}/manyalerts_test.go | 4 ++-- test/{smoketest => smoke}/messagebundlesms_test.go | 4 ++-- test/{smoketest => smoke}/messagebundlevoice_test.go | 4 ++-- test/{smoketest => smoke}/migrations_test.go | 4 ++-- test/{smoketest => smoke}/missinguser_test.go | 4 ++-- .../{smoketest => smoke}/multistepnotification_test.go | 4 ++-- test/{smoketest => smoke}/multiuser_test.go | 4 ++-- test/{smoketest => smoke}/oncallnotify_test.go | 4 ++-- test/{smoketest => smoke}/oncallnotifytod_test.go | 4 ++-- test/{smoketest => smoke}/overrideconflict_test.go | 4 ++-- test/{smoketest => smoke}/policyreassignment_test.go | 4 ++-- test/{smoketest => smoke}/postcyclerules_test.go | 4 ++-- test/{smoketest => smoke}/prioritization_test.go | 4 ++-- .../prometheusalertmanager_test.go | 4 ++-- test/{smoketest => smoke}/rotationdaily_test.go | 4 ++-- test/{smoketest => smoke}/rotationdeluser_test.go | 4 ++-- test/{smoketest => smoke}/rotationdst_test.go | 4 ++-- test/{smoketest => smoke}/rotationgap_test.go | 4 ++-- test/{smoketest => smoke}/rotationhourly_test.go | 4 ++-- test/{smoketest => smoke}/rotationweekly_test.go | 4 ++-- test/{smoketest => smoke}/rotationwrap_test.go | 4 ++-- test/{smoketest => smoke}/schedulerule_test.go | 4 ++-- .../servicemaintenancealert_test.go | 4 ++-- .../servicemaintenanceescalate_test.go | 4 ++-- test/{smoketest => smoke}/simplenotification_test.go | 4 ++-- test/{smoketest => smoke}/site24x7_test.go | 4 ++-- test/{smoketest => smoke}/slackaddtoepstep_test.go | 4 ++-- test/{smoketest => smoke}/slackchannels_test.go | 4 ++-- test/{smoketest => smoke}/slackinteraction_test.go | 4 ++-- test/{smoketest => smoke}/slacknotification_test.go | 4 ++-- test/{smoketest => smoke}/statusinprogress_test.go | 4 ++-- test/{smoketest => smoke}/statusupdates_test.go | 4 ++-- test/{smoketest => smoke}/statusupdatescancel_test.go | 4 ++-- test/{smoketest => smoke}/statusupdateschannel_test.go | 4 ++-- test/{smoketest => smoke}/switchover_test.go | 4 ++-- test/{smoketest => smoke}/systemlimits_test.go | 4 ++-- test/{smoketest => smoke}/tempschedules_test.go | 4 ++-- test/{smoketest => smoke}/twilioenablebysms_test.go | 4 ++-- test/{smoketest => smoke}/twilioenablebyvoice_test.go | 4 ++-- test/{smoketest => smoke}/twilioonewaysms_test.go | 4 ++-- test/{smoketest => smoke}/twiliosid_test.go | 4 ++-- test/{smoketest => smoke}/twiliosmsack_test.go | 4 ++-- test/{smoketest => smoke}/twiliosmsclose_test.go | 4 ++-- test/{smoketest => smoke}/twiliosmsfailure_test.go | 4 ++-- .../{smoketest => smoke}/twiliosmsfromoverride_test.go | 4 ++-- test/{smoketest => smoke}/twiliosmsreplycode_test.go | 4 ++-- test/{smoketest => smoke}/twiliosmsreplyignore_test.go | 4 ++-- test/{smoketest => smoke}/twiliosmsreplylast_test.go | 4 ++-- test/{smoketest => smoke}/twiliosmsreplylimit_test.go | 4 ++-- test/{smoketest => smoke}/twiliosmsstopstart_test.go | 4 ++-- .../twiliosmstrailingspace_test.go | 4 ++-- test/{smoketest => smoke}/twiliosmsurl_test.go | 4 ++-- .../{smoketest => smoke}/twiliosmsverification_test.go | 4 ++-- test/{smoketest => smoke}/twiliotestsms_test.go | 4 ++-- test/{smoketest => smoke}/twiliotestvoice_test.go | 4 ++-- test/{smoketest => smoke}/twiliovoiceack_test.go | 4 ++-- test/{smoketest => smoke}/twiliovoiceclose_test.go | 4 ++-- .../twiliovoiceemptymessage_test.go | 4 ++-- test/{smoketest => smoke}/twiliovoicefailure_test.go | 4 ++-- test/{smoketest => smoke}/twiliovoicestop_test.go | 4 ++-- .../twiliovoiceverification_test.go | 4 ++-- test/{smoketest => smoke}/upload.sh | 2 +- test/{smoketest => smoke}/webhook_test.go | 4 ++-- 122 files changed, 218 insertions(+), 212 deletions(-) rename test/{smoketest => smoke}/README.md (100%) rename test/{smoketest => smoke}/addrules_test.go (97%) rename test/{smoketest => smoke}/alertcleanup_test.go (95%) rename test/{smoketest => smoke}/alertlog_test.go (98%) rename test/{smoketest => smoke}/calendarsubscription_test.go (96%) rename test/{smoketest => smoke}/cmtestdisable_test.go (92%) rename test/{smoketest => smoke}/dedupnotifications_test.go (95%) rename test/{smoketest => smoke}/deleteescalationpolicy_test.go (92%) rename test/{smoketest => smoke}/deleterotation_test.go (93%) rename test/{smoketest => smoke}/emailnotification_test.go (94%) rename test/{smoketest => smoke}/escalation_test.go (95%) rename test/{smoketest => smoke}/escalationgap_test.go (94%) rename test/{smoketest => smoke}/escalationnotification_test.go (96%) rename test/{smoketest => smoke}/genericapi_test.go (96%) rename test/{smoketest => smoke}/genericapiclose_test.go (97%) rename test/{smoketest => smoke}/genericapidedup_test.go (97%) rename test/{smoketest => smoke}/grafana_test.go (95%) rename test/{smoketest => smoke}/graphqlalert_test.go (98%) rename test/{smoketest => smoke}/graphqlalertlogs_test.go (96%) rename test/{smoketest => smoke}/graphqlalertsort_test.go (97%) rename test/{smoketest => smoke}/graphqlcalendarsubscriptions_test.go (98%) rename test/{smoketest => smoke}/graphqlcreateschedule_test.go (96%) rename test/{smoketest => smoke}/graphqlcreatescheduledefaultrotation_test.go (96%) rename test/{smoketest => smoke}/graphqlfavoriterotations_test.go (96%) rename test/{smoketest => smoke}/graphqlmultiplealerts_test.go (97%) rename test/{smoketest => smoke}/graphqlnotices_test.go (94%) rename test/{smoketest => smoke}/graphqlnotifiedalerts_test.go (97%) rename test/{smoketest => smoke}/graphqloncall_test.go (99%) rename test/{smoketest => smoke}/graphqloncallassignments_test.go (99%) rename test/{smoketest => smoke}/graphqlschedulefavorites_test.go (96%) rename test/{smoketest => smoke}/graphqlservicelabels_test.go (94%) rename test/{smoketest => smoke}/graphqlupdaterotation_test.go (98%) rename test/{smoketest => smoke}/graphqluserfavorites_test.go (97%) rename test/{smoketest => smoke}/graphqlusers_test.go (97%) rename test/{smoketest => smoke}/harness/backend.go (100%) rename test/{smoketest => smoke}/harness/datagen.go (100%) rename test/{smoketest => smoke}/harness/email.go (100%) rename test/{smoketest => smoke}/harness/graphql.go (100%) rename test/{smoketest => smoke}/harness/harness.go (100%) rename test/{smoketest => smoke}/harness/matchers.go (100%) rename test/{smoketest => smoke}/harness/phoneassertions.go (100%) rename test/{smoketest => smoke}/harness/slack.go (100%) rename test/{smoketest => smoke}/harness/sql.go (100%) rename test/{smoketest => smoke}/harness/sql_test.go (100%) rename test/{smoketest => smoke}/harness/twilioassertionapi.go (100%) rename test/{smoketest => smoke}/harness/twilioassertiondevice.go (100%) rename test/{smoketest => smoke}/harness/twilioassertionsms.go (100%) rename test/{smoketest => smoke}/harness/twilioassertionvoicecall.go (100%) rename test/{smoketest => smoke}/heartbeat_test.go (96%) rename test/{smoketest => smoke}/inprogress_test.go (97%) rename test/{smoketest => smoke}/listalerts_test.go (94%) rename test/{smoketest => smoke}/mailgunalerts_test.go (97%) rename test/{smoketest => smoke}/manualescalationnotification_test.go (96%) rename test/{smoketest => smoke}/manyalerts_test.go (96%) rename test/{smoketest => smoke}/messagebundlesms_test.go (96%) rename test/{smoketest => smoke}/messagebundlevoice_test.go (96%) rename test/{smoketest => smoke}/migrations_test.go (99%) rename test/{smoketest => smoke}/missinguser_test.go (98%) rename test/{smoketest => smoke}/multistepnotification_test.go (95%) rename test/{smoketest => smoke}/multiuser_test.go (96%) rename test/{smoketest => smoke}/oncallnotify_test.go (96%) rename test/{smoketest => smoke}/oncallnotifytod_test.go (95%) rename test/{smoketest => smoke}/overrideconflict_test.go (95%) rename test/{smoketest => smoke}/policyreassignment_test.go (96%) rename test/{smoketest => smoke}/postcyclerules_test.go (95%) rename test/{smoketest => smoke}/prioritization_test.go (96%) rename test/{smoketest => smoke}/prometheusalertmanager_test.go (96%) rename test/{smoketest => smoke}/rotationdaily_test.go (96%) rename test/{smoketest => smoke}/rotationdeluser_test.go (95%) rename test/{smoketest => smoke}/rotationdst_test.go (97%) rename test/{smoketest => smoke}/rotationgap_test.go (95%) rename test/{smoketest => smoke}/rotationhourly_test.go (96%) rename test/{smoketest => smoke}/rotationweekly_test.go (96%) rename test/{smoketest => smoke}/rotationwrap_test.go (96%) rename test/{smoketest => smoke}/schedulerule_test.go (97%) rename test/{smoketest => smoke}/servicemaintenancealert_test.go (96%) rename test/{smoketest => smoke}/servicemaintenanceescalate_test.go (97%) rename test/{smoketest => smoke}/simplenotification_test.go (98%) rename test/{smoketest => smoke}/site24x7_test.go (96%) rename test/{smoketest => smoke}/slackaddtoepstep_test.go (93%) rename test/{smoketest => smoke}/slackchannels_test.go (95%) rename test/{smoketest => smoke}/slackinteraction_test.go (96%) rename test/{smoketest => smoke}/slacknotification_test.go (93%) rename test/{smoketest => smoke}/statusinprogress_test.go (96%) rename test/{smoketest => smoke}/statusupdates_test.go (97%) rename test/{smoketest => smoke}/statusupdatescancel_test.go (97%) rename test/{smoketest => smoke}/statusupdateschannel_test.go (95%) rename test/{smoketest => smoke}/switchover_test.go (85%) rename test/{smoketest => smoke}/systemlimits_test.go (99%) rename test/{smoketest => smoke}/tempschedules_test.go (97%) rename test/{smoketest => smoke}/twilioenablebysms_test.go (96%) rename test/{smoketest => smoke}/twilioenablebyvoice_test.go (96%) rename test/{smoketest => smoke}/twilioonewaysms_test.go (95%) rename test/{smoketest => smoke}/twiliosid_test.go (96%) rename test/{smoketest => smoke}/twiliosmsack_test.go (95%) rename test/{smoketest => smoke}/twiliosmsclose_test.go (95%) rename test/{smoketest => smoke}/twiliosmsfailure_test.go (94%) rename test/{smoketest => smoke}/twiliosmsfromoverride_test.go (96%) rename test/{smoketest => smoke}/twiliosmsreplycode_test.go (95%) rename test/{smoketest => smoke}/twiliosmsreplyignore_test.go (92%) rename test/{smoketest => smoke}/twiliosmsreplylast_test.go (95%) rename test/{smoketest => smoke}/twiliosmsreplylimit_test.go (95%) rename test/{smoketest => smoke}/twiliosmsstopstart_test.go (96%) rename test/{smoketest => smoke}/twiliosmstrailingspace_test.go (94%) rename test/{smoketest => smoke}/twiliosmsurl_test.go (97%) rename test/{smoketest => smoke}/twiliosmsverification_test.go (95%) rename test/{smoketest => smoke}/twiliotestsms_test.go (92%) rename test/{smoketest => smoke}/twiliotestvoice_test.go (92%) rename test/{smoketest => smoke}/twiliovoiceack_test.go (95%) rename test/{smoketest => smoke}/twiliovoiceclose_test.go (95%) rename test/{smoketest => smoke}/twiliovoiceemptymessage_test.go (94%) rename test/{smoketest => smoke}/twiliovoicefailure_test.go (94%) rename test/{smoketest => smoke}/twiliovoicestop_test.go (95%) rename test/{smoketest => smoke}/twiliovoiceverification_test.go (97%) rename test/{smoketest => smoke}/upload.sh (93%) rename test/{smoketest => smoke}/webhook_test.go (96%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7757ae99d3..6587e93b9b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -35,7 +35,7 @@ Be sure to run `make check` and tests before opening a PR to catch common errors ### Backend Change Guidelines - Use unit tests as a tool to validate complex logic. For [example](./schedule/rule/weekdayfilter_test.go). -- New functionality should have a behavioral smoketest at a minimum. For [example](./test/smoketest/simplenotification_test.go). Documentation on our smoketest framework can be found [here](./test/smoketest/README.md). +- New functionality should have a behavioral smoke test at a minimum. For [example](./test/smoke/simplenotification_test.go). Documentation on our smoke test framework can be found [here](./test/smoke/README.md). - Go code should [follow best practices](https://golang.org/doc/effective_go.html), exported functions/methods should be commented, etc.. ## Testing diff --git a/Makefile b/Makefile index e3b79c6cbc..aae5ab1ee8 100644 --- a/Makefile +++ b/Makefile @@ -143,11 +143,17 @@ pkg/sysapi/sysapi.pb.go: pkg/sysapi/sysapi.proto $(BIN_DIR)/tools/protoc-gen-go generate: node_modules pkg/sysapi/sysapi.pb.go pkg/sysapi/sysapi_grpc.pb.go go generate ./... + +test-all: test-unit test-smoke test-integration +test-integration: cy-wide-prod-run cy-mobile-prod-run +test-smoke: smoketest +test-unit: test + smoketest: - (cd test/smoketest && go test -parallel 10 -timeout 20m) + (cd test/smoke && go test -parallel 10 -timeout 20m) test-migrations: bin/goalert - (cd test/smoketest && go test -run TestMigrations) + (cd test/smoke && go test -run TestMigrations) tools: go get -u golang.org/x/tools/cmd/gorename diff --git a/devtools/ci/tasks/scripts/build-all.sh b/devtools/ci/tasks/scripts/build-all.sh index c2418dc1b2..8c45d20ce1 100644 --- a/devtools/ci/tasks/scripts/build-all.sh +++ b/devtools/ci/tasks/scripts/build-all.sh @@ -5,7 +5,7 @@ PREFIX=$1 start_postgres trap "stop_postgres" EXIT -make check test smoketest cy-wide-prod-run cy-mobile-prod-run bin/goalert BUNDLE=1 CI=1 DB_URL=$DB_URL +make check test-all bin/goalert BUNDLE=1 CI=1 DB_URL=$DB_URL ./bin/goalert self-test --offline VERSION=$(./bin/goalert version | head -n 1 |awk '{print $2}') diff --git a/devtools/ci/tasks/scripts/test-smoketest.sh b/devtools/ci/tasks/scripts/test-smoketest.sh index b20b6e5898..a1607a5215 100755 --- a/devtools/ci/tasks/scripts/test-smoketest.sh +++ b/devtools/ci/tasks/scripts/test-smoketest.sh @@ -2,6 +2,6 @@ set -x start_postgres -trap "stop_postgres; tar czf ../debug/debug-$(date +%Y%m%d%H%M%S)-$(git rev-parse HEAD)-smoketest.tgz -C .. goalert/test/smoketest/smoketest_db_dump" EXIT +trap "stop_postgres; tar czf ../debug/debug-$(date +%Y%m%d%H%M%S)-$(git rev-parse HEAD)-smoketest.tgz -C .. goalert/test/smoke/smoketest_db_dump" EXIT -make -e smoketest DB_URL=$DB_URL +make -e test-smoke DB_URL=$DB_URL diff --git a/devtools/psql-lite/main.go b/devtools/psql-lite/main.go index 46cb7f092f..ace456016b 100644 --- a/devtools/psql-lite/main.go +++ b/devtools/psql-lite/main.go @@ -5,7 +5,7 @@ import ( "flag" "log" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func main() { diff --git a/docs/development-setup.md b/docs/development-setup.md index 915b41b4c6..f25b0c80ae 100644 --- a/docs/development-setup.md +++ b/docs/development-setup.md @@ -73,17 +73,17 @@ The Cypress UI should start automatically. More information about browser tests can be found [here](../web/src/cypress/README.md). -### Running Smoketests +### Running Smoke Tests A suite of functional/behavioral tests are maintained for the backend code. These test various APIs and behaviors of the GoAlert server component. -Run the full suite with `make smoketest`. +Run the full suite with `make test-smoke`. -More information about smoketests can be found [here](../test/smoketest/README.md). +More information about smoke tests can be found [here](../test/smoke/README.md). ### Running Unit Tests -All unit tests can be run with `make test`. +All unit tests can be run with `make test-unit`. UI Unit tests are found under the directory of the file being tested, with the same file name, appended with `.test.js`. They can be run independently of the Go unit tests with `make jest`. Watch mode can be enabled with `make jest JEST_ARGS=--watch`. diff --git a/test/smoketest/README.md b/test/smoke/README.md similarity index 100% rename from test/smoketest/README.md rename to test/smoke/README.md diff --git a/test/smoketest/addrules_test.go b/test/smoke/addrules_test.go similarity index 97% rename from test/smoketest/addrules_test.go rename to test/smoke/addrules_test.go index e63c1060a6..db02019ce5 100644 --- a/test/smoketest/addrules_test.go +++ b/test/smoke/addrules_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) /* diff --git a/test/smoketest/alertcleanup_test.go b/test/smoke/alertcleanup_test.go similarity index 95% rename from test/smoketest/alertcleanup_test.go rename to test/smoke/alertcleanup_test.go index a01afad5ed..5524d74533 100644 --- a/test/smoketest/alertcleanup_test.go +++ b/test/smoke/alertcleanup_test.go @@ -1,11 +1,11 @@ -package smoketest +package smoke import ( "encoding/json" "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestAlertCleanup verifies that old alerts are purged from the DB diff --git a/test/smoketest/alertlog_test.go b/test/smoke/alertlog_test.go similarity index 98% rename from test/smoketest/alertlog_test.go rename to test/smoke/alertlog_test.go index a77577770c..ab0eaddc45 100644 --- a/test/smoketest/alertlog_test.go +++ b/test/smoke/alertlog_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "encoding/json" @@ -6,7 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func TestAlertLog(t *testing.T) { diff --git a/test/smoketest/calendarsubscription_test.go b/test/smoke/calendarsubscription_test.go similarity index 96% rename from test/smoketest/calendarsubscription_test.go rename to test/smoke/calendarsubscription_test.go index ea2cb48cba..7c46794867 100644 --- a/test/smoketest/calendarsubscription_test.go +++ b/test/smoke/calendarsubscription_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "encoding/json" @@ -8,7 +8,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func TestCalendarSubscription(t *testing.T) { diff --git a/test/smoketest/cmtestdisable_test.go b/test/smoke/cmtestdisable_test.go similarity index 92% rename from test/smoketest/cmtestdisable_test.go rename to test/smoke/cmtestdisable_test.go index 98e67b7d25..702175a706 100644 --- a/test/smoketest/cmtestdisable_test.go +++ b/test/smoke/cmtestdisable_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestCMTestDisable checks for a condition where a test message is scheduled but the contact method is immediately disabled. diff --git a/test/smoketest/dedupnotifications_test.go b/test/smoke/dedupnotifications_test.go similarity index 95% rename from test/smoketest/dedupnotifications_test.go rename to test/smoke/dedupnotifications_test.go index 103b7afcff..fad260bd92 100644 --- a/test/smoketest/dedupnotifications_test.go +++ b/test/smoke/dedupnotifications_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestDedupNotifications tests that if a single contact method is diff --git a/test/smoketest/deleteescalationpolicy_test.go b/test/smoke/deleteescalationpolicy_test.go similarity index 92% rename from test/smoketest/deleteescalationpolicy_test.go rename to test/smoke/deleteescalationpolicy_test.go index 72c44367d9..2dac2487c6 100644 --- a/test/smoketest/deleteescalationpolicy_test.go +++ b/test/smoke/deleteescalationpolicy_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "fmt" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestDeleteEscalationPolicy tests that it is possible to delete an escalation policy diff --git a/test/smoketest/deleterotation_test.go b/test/smoke/deleterotation_test.go similarity index 93% rename from test/smoketest/deleterotation_test.go rename to test/smoke/deleterotation_test.go index 841ba21905..5b168a4441 100644 --- a/test/smoketest/deleterotation_test.go +++ b/test/smoke/deleterotation_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "fmt" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestDeleteRotation tests that it is possible to delete a rotation with participants diff --git a/test/smoketest/emailnotification_test.go b/test/smoke/emailnotification_test.go similarity index 94% rename from test/smoketest/emailnotification_test.go rename to test/smoke/emailnotification_test.go index 302ab6dc7d..1689280cfd 100644 --- a/test/smoketest/emailnotification_test.go +++ b/test/smoke/emailnotification_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestEmailNotification tests that email notifications are delivered. diff --git a/test/smoketest/escalation_test.go b/test/smoke/escalation_test.go similarity index 95% rename from test/smoketest/escalation_test.go rename to test/smoke/escalation_test.go index 12b575892e..0efc7e1cc8 100644 --- a/test/smoketest/escalation_test.go +++ b/test/smoke/escalation_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestEscalation tests that alerts are escalated automatically, per the delay_minutes setting. diff --git a/test/smoketest/escalationgap_test.go b/test/smoke/escalationgap_test.go similarity index 94% rename from test/smoketest/escalationgap_test.go rename to test/smoke/escalationgap_test.go index 98478e0781..0b117e4b4a 100644 --- a/test/smoketest/escalationgap_test.go +++ b/test/smoke/escalationgap_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestEscalationGap tests that escalation policy step discrepencies are handled. diff --git a/test/smoketest/escalationnotification_test.go b/test/smoke/escalationnotification_test.go similarity index 96% rename from test/smoketest/escalationnotification_test.go rename to test/smoke/escalationnotification_test.go index e896be8d17..019500e1ca 100644 --- a/test/smoketest/escalationnotification_test.go +++ b/test/smoke/escalationnotification_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestEscalationNotification ensures that notification rules diff --git a/test/smoketest/genericapi_test.go b/test/smoke/genericapi_test.go similarity index 96% rename from test/smoketest/genericapi_test.go rename to test/smoke/genericapi_test.go index 6105d2d783..2e48174907 100644 --- a/test/smoketest/genericapi_test.go +++ b/test/smoke/genericapi_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "bytes" @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func TestGenericAPI(t *testing.T) { diff --git a/test/smoketest/genericapiclose_test.go b/test/smoke/genericapiclose_test.go similarity index 97% rename from test/smoketest/genericapiclose_test.go rename to test/smoke/genericapiclose_test.go index 62f603a9f5..2e65f425f9 100644 --- a/test/smoketest/genericapiclose_test.go +++ b/test/smoke/genericapiclose_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "bytes" @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func TestGenericAPIClose(t *testing.T) { diff --git a/test/smoketest/genericapidedup_test.go b/test/smoke/genericapidedup_test.go similarity index 97% rename from test/smoketest/genericapidedup_test.go rename to test/smoke/genericapidedup_test.go index 93b51eb93b..661a4fb549 100644 --- a/test/smoketest/genericapidedup_test.go +++ b/test/smoke/genericapidedup_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "bytes" @@ -6,7 +6,7 @@ import ( "net/url" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func TestGenericAPIDedup(t *testing.T) { diff --git a/test/smoketest/grafana_test.go b/test/smoke/grafana_test.go similarity index 95% rename from test/smoketest/grafana_test.go rename to test/smoke/grafana_test.go index 5deaadd3e8..a099d4c0c8 100644 --- a/test/smoketest/grafana_test.go +++ b/test/smoke/grafana_test.go @@ -1,11 +1,11 @@ -package smoketest +package smoke import ( "bytes" "net/http" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func TestGrafana(t *testing.T) { diff --git a/test/smoketest/graphqlalert_test.go b/test/smoke/graphqlalert_test.go similarity index 98% rename from test/smoketest/graphqlalert_test.go rename to test/smoke/graphqlalert_test.go index 2e64024507..353212efe5 100644 --- a/test/smoketest/graphqlalert_test.go +++ b/test/smoke/graphqlalert_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "encoding/json" @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestGraphQLAlert tests that all steps up to, and including, generating diff --git a/test/smoketest/graphqlalertlogs_test.go b/test/smoke/graphqlalertlogs_test.go similarity index 96% rename from test/smoketest/graphqlalertlogs_test.go rename to test/smoke/graphqlalertlogs_test.go index 88773d362f..11ae01ccaf 100644 --- a/test/smoketest/graphqlalertlogs_test.go +++ b/test/smoke/graphqlalertlogs_test.go @@ -1,11 +1,11 @@ -package smoketest +package smoke import ( "encoding/json" "fmt" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestGraphQLAlertLogs tests that logs are properly generated for an alert. diff --git a/test/smoketest/graphqlalertsort_test.go b/test/smoke/graphqlalertsort_test.go similarity index 97% rename from test/smoketest/graphqlalertsort_test.go rename to test/smoke/graphqlalertsort_test.go index 12fe407299..efdc341e55 100644 --- a/test/smoketest/graphqlalertsort_test.go +++ b/test/smoke/graphqlalertsort_test.go @@ -1,11 +1,11 @@ -package smoketest +package smoke import ( "encoding/json" "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestGraphQLAlertSort verifies that the alerts query sorts results properly. diff --git a/test/smoketest/graphqlcalendarsubscriptions_test.go b/test/smoke/graphqlcalendarsubscriptions_test.go similarity index 98% rename from test/smoketest/graphqlcalendarsubscriptions_test.go rename to test/smoke/graphqlcalendarsubscriptions_test.go index e542b88451..82b9e0dcf3 100644 --- a/test/smoketest/graphqlcalendarsubscriptions_test.go +++ b/test/smoke/graphqlcalendarsubscriptions_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "encoding/json" @@ -6,7 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) type calSub struct { diff --git a/test/smoketest/graphqlcreateschedule_test.go b/test/smoke/graphqlcreateschedule_test.go similarity index 96% rename from test/smoketest/graphqlcreateschedule_test.go rename to test/smoke/graphqlcreateschedule_test.go index 60e63ae311..01c8b645ee 100644 --- a/test/smoketest/graphqlcreateschedule_test.go +++ b/test/smoke/graphqlcreateschedule_test.go @@ -1,11 +1,11 @@ -package smoketest +package smoke import ( "encoding/json" "fmt" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestGraphQLCreateSchedule tests that all steps for creating a schedule (without default rotation) are carried out without any errors. diff --git a/test/smoketest/graphqlcreatescheduledefaultrotation_test.go b/test/smoke/graphqlcreatescheduledefaultrotation_test.go similarity index 96% rename from test/smoketest/graphqlcreatescheduledefaultrotation_test.go rename to test/smoke/graphqlcreatescheduledefaultrotation_test.go index 6a8e36eb77..3176076c30 100644 --- a/test/smoketest/graphqlcreatescheduledefaultrotation_test.go +++ b/test/smoke/graphqlcreatescheduledefaultrotation_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "encoding/json" @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestGraphQLCreateScheduleWithDefaultRotation tests that all steps for creating a schedule with default rotation are carried out without any errors. diff --git a/test/smoketest/graphqlfavoriterotations_test.go b/test/smoke/graphqlfavoriterotations_test.go similarity index 96% rename from test/smoketest/graphqlfavoriterotations_test.go rename to test/smoke/graphqlfavoriterotations_test.go index dba6da38f1..eba5318c23 100644 --- a/test/smoketest/graphqlfavoriterotations_test.go +++ b/test/smoke/graphqlfavoriterotations_test.go @@ -1,11 +1,11 @@ -package smoketest +package smoke import ( "encoding/json" "fmt" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func TestGraphQLFavoriteRotations(t *testing.T) { diff --git a/test/smoketest/graphqlmultiplealerts_test.go b/test/smoke/graphqlmultiplealerts_test.go similarity index 97% rename from test/smoketest/graphqlmultiplealerts_test.go rename to test/smoke/graphqlmultiplealerts_test.go index 1f17b6589d..f4e34e58eb 100644 --- a/test/smoketest/graphqlmultiplealerts_test.go +++ b/test/smoke/graphqlmultiplealerts_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "encoding/json" @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestGraphQLMultipleAlerts tests that all steps up to, and including, generating diff --git a/test/smoketest/graphqlnotices_test.go b/test/smoke/graphqlnotices_test.go similarity index 94% rename from test/smoketest/graphqlnotices_test.go rename to test/smoke/graphqlnotices_test.go index 40eea96ac7..ce31bfce27 100644 --- a/test/smoketest/graphqlnotices_test.go +++ b/test/smoke/graphqlnotices_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "encoding/json" @@ -6,7 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestNotices tests notices are properly returned given the appropriate scenarios. diff --git a/test/smoketest/graphqlnotifiedalerts_test.go b/test/smoke/graphqlnotifiedalerts_test.go similarity index 97% rename from test/smoketest/graphqlnotifiedalerts_test.go rename to test/smoke/graphqlnotifiedalerts_test.go index 1e595203f9..380a9bc1b7 100644 --- a/test/smoketest/graphqlnotifiedalerts_test.go +++ b/test/smoke/graphqlnotifiedalerts_test.go @@ -1,11 +1,11 @@ -package smoketest +package smoke import ( "encoding/json" "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestNotifiedAlerts tests that the alerts GraphQL query shows the proper amount of results when flipping between "includeNotified" and "favoritesOnly" query options. diff --git a/test/smoketest/graphqloncall_test.go b/test/smoke/graphqloncall_test.go similarity index 99% rename from test/smoketest/graphqloncall_test.go rename to test/smoke/graphqloncall_test.go index 64ccfd900f..5b6d0249a4 100644 --- a/test/smoketest/graphqloncall_test.go +++ b/test/smoke/graphqloncall_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "bytes" @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" "github.com/target/goalert/user" ) diff --git a/test/smoketest/graphqloncallassignments_test.go b/test/smoke/graphqloncallassignments_test.go similarity index 99% rename from test/smoketest/graphqloncallassignments_test.go rename to test/smoke/graphqloncallassignments_test.go index 774c0935f6..0a46ab9bae 100644 --- a/test/smoketest/graphqloncallassignments_test.go +++ b/test/smoke/graphqloncallassignments_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "bytes" @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" "github.com/target/goalert/user" ) diff --git a/test/smoketest/graphqlschedulefavorites_test.go b/test/smoke/graphqlschedulefavorites_test.go similarity index 96% rename from test/smoketest/graphqlschedulefavorites_test.go rename to test/smoke/graphqlschedulefavorites_test.go index 5844bf2e5d..08ee89f746 100644 --- a/test/smoketest/graphqlschedulefavorites_test.go +++ b/test/smoke/graphqlschedulefavorites_test.go @@ -1,11 +1,11 @@ -package smoketest +package smoke import ( "encoding/json" "fmt" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestGraphQLScheduleFavorites tests that schedules can be set and unset as user favorites diff --git a/test/smoketest/graphqlservicelabels_test.go b/test/smoke/graphqlservicelabels_test.go similarity index 94% rename from test/smoketest/graphqlservicelabels_test.go rename to test/smoke/graphqlservicelabels_test.go index e55809f7d5..afd7ef6987 100644 --- a/test/smoketest/graphqlservicelabels_test.go +++ b/test/smoke/graphqlservicelabels_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "fmt" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestGraphQLServiceLabels tests that labels for services can be created diff --git a/test/smoketest/graphqlupdaterotation_test.go b/test/smoke/graphqlupdaterotation_test.go similarity index 98% rename from test/smoketest/graphqlupdaterotation_test.go rename to test/smoke/graphqlupdaterotation_test.go index 466cc5a422..542250c667 100644 --- a/test/smoketest/graphqlupdaterotation_test.go +++ b/test/smoke/graphqlupdaterotation_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "encoding/json" @@ -6,7 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestGraphQLUpdateRotation tests that all steps like creating and updating rotations are carried out without any errors. diff --git a/test/smoketest/graphqluserfavorites_test.go b/test/smoke/graphqluserfavorites_test.go similarity index 97% rename from test/smoketest/graphqluserfavorites_test.go rename to test/smoke/graphqluserfavorites_test.go index 80f052abde..08cb21aef2 100644 --- a/test/smoketest/graphqluserfavorites_test.go +++ b/test/smoke/graphqluserfavorites_test.go @@ -1,11 +1,11 @@ -package smoketest +package smoke import ( "encoding/json" "fmt" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestGraphQLUserFavorites tests that services can be set and unset as user favorites diff --git a/test/smoketest/graphqlusers_test.go b/test/smoke/graphqlusers_test.go similarity index 97% rename from test/smoketest/graphqlusers_test.go rename to test/smoke/graphqlusers_test.go index d8c05e7803..73761aa935 100644 --- a/test/smoketest/graphqlusers_test.go +++ b/test/smoke/graphqlusers_test.go @@ -1,11 +1,11 @@ -package smoketest +package smoke import ( "encoding/json" "fmt" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestGraphQLUsers tests most operations on users API via GraphQL endpoint. diff --git a/test/smoketest/harness/backend.go b/test/smoke/harness/backend.go similarity index 100% rename from test/smoketest/harness/backend.go rename to test/smoke/harness/backend.go diff --git a/test/smoketest/harness/datagen.go b/test/smoke/harness/datagen.go similarity index 100% rename from test/smoketest/harness/datagen.go rename to test/smoke/harness/datagen.go diff --git a/test/smoketest/harness/email.go b/test/smoke/harness/email.go similarity index 100% rename from test/smoketest/harness/email.go rename to test/smoke/harness/email.go diff --git a/test/smoketest/harness/graphql.go b/test/smoke/harness/graphql.go similarity index 100% rename from test/smoketest/harness/graphql.go rename to test/smoke/harness/graphql.go diff --git a/test/smoketest/harness/harness.go b/test/smoke/harness/harness.go similarity index 100% rename from test/smoketest/harness/harness.go rename to test/smoke/harness/harness.go diff --git a/test/smoketest/harness/matchers.go b/test/smoke/harness/matchers.go similarity index 100% rename from test/smoketest/harness/matchers.go rename to test/smoke/harness/matchers.go diff --git a/test/smoketest/harness/phoneassertions.go b/test/smoke/harness/phoneassertions.go similarity index 100% rename from test/smoketest/harness/phoneassertions.go rename to test/smoke/harness/phoneassertions.go diff --git a/test/smoketest/harness/slack.go b/test/smoke/harness/slack.go similarity index 100% rename from test/smoketest/harness/slack.go rename to test/smoke/harness/slack.go diff --git a/test/smoketest/harness/sql.go b/test/smoke/harness/sql.go similarity index 100% rename from test/smoketest/harness/sql.go rename to test/smoke/harness/sql.go diff --git a/test/smoketest/harness/sql_test.go b/test/smoke/harness/sql_test.go similarity index 100% rename from test/smoketest/harness/sql_test.go rename to test/smoke/harness/sql_test.go diff --git a/test/smoketest/harness/twilioassertionapi.go b/test/smoke/harness/twilioassertionapi.go similarity index 100% rename from test/smoketest/harness/twilioassertionapi.go rename to test/smoke/harness/twilioassertionapi.go diff --git a/test/smoketest/harness/twilioassertiondevice.go b/test/smoke/harness/twilioassertiondevice.go similarity index 100% rename from test/smoketest/harness/twilioassertiondevice.go rename to test/smoke/harness/twilioassertiondevice.go diff --git a/test/smoketest/harness/twilioassertionsms.go b/test/smoke/harness/twilioassertionsms.go similarity index 100% rename from test/smoketest/harness/twilioassertionsms.go rename to test/smoke/harness/twilioassertionsms.go diff --git a/test/smoketest/harness/twilioassertionvoicecall.go b/test/smoke/harness/twilioassertionvoicecall.go similarity index 100% rename from test/smoketest/harness/twilioassertionvoicecall.go rename to test/smoke/harness/twilioassertionvoicecall.go diff --git a/test/smoketest/heartbeat_test.go b/test/smoke/heartbeat_test.go similarity index 96% rename from test/smoketest/heartbeat_test.go rename to test/smoke/heartbeat_test.go index 41ca423f43..9f9f472960 100644 --- a/test/smoketest/heartbeat_test.go +++ b/test/smoke/heartbeat_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "net/http" @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func TestHeartbeat(t *testing.T) { diff --git a/test/smoketest/inprogress_test.go b/test/smoke/inprogress_test.go similarity index 97% rename from test/smoketest/inprogress_test.go rename to test/smoke/inprogress_test.go index 531151663a..00f02ce4a1 100644 --- a/test/smoketest/inprogress_test.go +++ b/test/smoke/inprogress_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestInProgress ensures that sent and in-progress notifications for triggered alerts are honored through the migration. diff --git a/test/smoketest/listalerts_test.go b/test/smoke/listalerts_test.go similarity index 94% rename from test/smoketest/listalerts_test.go rename to test/smoke/listalerts_test.go index 7d26e92b64..bf3ffc7bd5 100644 --- a/test/smoketest/listalerts_test.go +++ b/test/smoke/listalerts_test.go @@ -1,11 +1,11 @@ -package smoketest +package smoke import ( "encoding/json" "strconv" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func TestListAlerts(t *testing.T) { diff --git a/test/smoketest/mailgunalerts_test.go b/test/smoke/mailgunalerts_test.go similarity index 97% rename from test/smoketest/mailgunalerts_test.go rename to test/smoke/mailgunalerts_test.go index cbb729c05b..fbbf1f7931 100644 --- a/test/smoketest/mailgunalerts_test.go +++ b/test/smoke/mailgunalerts_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "crypto/hmac" @@ -12,7 +12,7 @@ import ( "time" "github.com/stretchr/testify/assert" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestMailgunAlerts tests that GoAlert responds and diff --git a/test/smoketest/manualescalationnotification_test.go b/test/smoke/manualescalationnotification_test.go similarity index 96% rename from test/smoketest/manualescalationnotification_test.go rename to test/smoke/manualescalationnotification_test.go index a057b378b2..f351334cbe 100644 --- a/test/smoketest/manualescalationnotification_test.go +++ b/test/smoke/manualescalationnotification_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestManualEscalation ensures that second step notifications are sent out when an acknowledged alert is manually escalated. diff --git a/test/smoketest/manyalerts_test.go b/test/smoke/manyalerts_test.go similarity index 96% rename from test/smoketest/manyalerts_test.go rename to test/smoke/manyalerts_test.go index faa01d18a8..45b8af496a 100644 --- a/test/smoketest/manyalerts_test.go +++ b/test/smoke/manyalerts_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "fmt" @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestManyAlerts ensures repeated alert -> msg -> close sequences work properly as long as the delay between diff --git a/test/smoketest/messagebundlesms_test.go b/test/smoke/messagebundlesms_test.go similarity index 96% rename from test/smoketest/messagebundlesms_test.go rename to test/smoke/messagebundlesms_test.go index 3049ecb389..2520fd9640 100644 --- a/test/smoketest/messagebundlesms_test.go +++ b/test/smoke/messagebundlesms_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestMessageBundle_SMS checks that SMS status updates and alert notifications are bundled when General.MessageBundles is enabled. diff --git a/test/smoketest/messagebundlevoice_test.go b/test/smoke/messagebundlevoice_test.go similarity index 96% rename from test/smoketest/messagebundlevoice_test.go rename to test/smoke/messagebundlevoice_test.go index baff2f6844..73d9a69cc5 100644 --- a/test/smoketest/messagebundlevoice_test.go +++ b/test/smoke/messagebundlevoice_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestMessageBundle_Voice checks that SMS status updates and alert notifications are bundled when General.MessageBundles is enabled. diff --git a/test/smoketest/migrations_test.go b/test/smoke/migrations_test.go similarity index 99% rename from test/smoketest/migrations_test.go rename to test/smoke/migrations_test.go index 0f439c3fc6..94c42588ba 100644 --- a/test/smoketest/migrations_test.go +++ b/test/smoke/migrations_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "bufio" @@ -19,7 +19,7 @@ import ( "github.com/google/uuid" _ "github.com/jackc/pgx/v4/stdlib" // import db driver "github.com/target/goalert/migrate" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" "github.com/target/goalert/util/sqlutil" ) diff --git a/test/smoketest/missinguser_test.go b/test/smoke/missinguser_test.go similarity index 98% rename from test/smoketest/missinguser_test.go rename to test/smoke/missinguser_test.go index e67fe71f4f..52bd4e3bfc 100644 --- a/test/smoketest/missinguser_test.go +++ b/test/smoke/missinguser_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestMissingUser tests that notifications go out, even when data is in an odd state. diff --git a/test/smoketest/multistepnotification_test.go b/test/smoke/multistepnotification_test.go similarity index 95% rename from test/smoketest/multistepnotification_test.go rename to test/smoke/multistepnotification_test.go index cf3900765d..47888cc0cc 100644 --- a/test/smoketest/multistepnotification_test.go +++ b/test/smoke/multistepnotification_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestMultiStepNotifications tests that SMS and Voice goes out for diff --git a/test/smoketest/multiuser_test.go b/test/smoke/multiuser_test.go similarity index 96% rename from test/smoketest/multiuser_test.go rename to test/smoke/multiuser_test.go index 3991946ef3..ba73bd5bf7 100644 --- a/test/smoketest/multiuser_test.go +++ b/test/smoke/multiuser_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestMultiUser checks that if multiple users are assigned to a policy step, diff --git a/test/smoketest/oncallnotify_test.go b/test/smoke/oncallnotify_test.go similarity index 96% rename from test/smoketest/oncallnotify_test.go rename to test/smoke/oncallnotify_test.go index 36c6ad6f27..24013e7379 100644 --- a/test/smoketest/oncallnotify_test.go +++ b/test/smoke/oncallnotify_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "context" @@ -10,7 +10,7 @@ import ( "github.com/target/goalert/assignment" "github.com/target/goalert/permission" "github.com/target/goalert/schedule/rule" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" "github.com/target/goalert/util/timeutil" ) diff --git a/test/smoketest/oncallnotifytod_test.go b/test/smoke/oncallnotifytod_test.go similarity index 95% rename from test/smoketest/oncallnotifytod_test.go rename to test/smoke/oncallnotifytod_test.go index 2ebc1c9f9c..5659b70ba1 100644 --- a/test/smoketest/oncallnotifytod_test.go +++ b/test/smoke/oncallnotifytod_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestOnCallNotifyTOD will test that time-of-day on-call notifications work. diff --git a/test/smoketest/overrideconflict_test.go b/test/smoke/overrideconflict_test.go similarity index 95% rename from test/smoketest/overrideconflict_test.go rename to test/smoke/overrideconflict_test.go index c67a73c6f9..dbf9d90f44 100644 --- a/test/smoketest/overrideconflict_test.go +++ b/test/smoke/overrideconflict_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "context" @@ -9,7 +9,7 @@ import ( "github.com/target/goalert/assignment" "github.com/target/goalert/override" "github.com/target/goalert/permission" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func TestOverrideConflict(t *testing.T) { diff --git a/test/smoketest/policyreassignment_test.go b/test/smoke/policyreassignment_test.go similarity index 96% rename from test/smoketest/policyreassignment_test.go rename to test/smoke/policyreassignment_test.go index 1fe56525fa..88dfbd5556 100644 --- a/test/smoketest/policyreassignment_test.go +++ b/test/smoke/policyreassignment_test.go @@ -1,11 +1,11 @@ -package smoketest +package smoke import ( "fmt" "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestPolicyReassignment tests that only the active escalation policy is used for alerts. diff --git a/test/smoketest/postcyclerules_test.go b/test/smoke/postcyclerules_test.go similarity index 95% rename from test/smoketest/postcyclerules_test.go rename to test/smoke/postcyclerules_test.go index acebd031fe..e190092cb1 100644 --- a/test/smoketest/postcyclerules_test.go +++ b/test/smoke/postcyclerules_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestPostCycleRules checks that new rules added after the last diff --git a/test/smoketest/prioritization_test.go b/test/smoke/prioritization_test.go similarity index 96% rename from test/smoketest/prioritization_test.go rename to test/smoke/prioritization_test.go index 87de15578f..0ee8025060 100644 --- a/test/smoketest/prioritization_test.go +++ b/test/smoke/prioritization_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "bytes" @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestPrioritization tests that notifications for new users/alerts get diff --git a/test/smoketest/prometheusalertmanager_test.go b/test/smoke/prometheusalertmanager_test.go similarity index 96% rename from test/smoketest/prometheusalertmanager_test.go rename to test/smoke/prometheusalertmanager_test.go index 1910ffec7c..1e912a1f37 100644 --- a/test/smoketest/prometheusalertmanager_test.go +++ b/test/smoke/prometheusalertmanager_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "bytes" @@ -6,7 +6,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func TestPrometheusAlertManager(t *testing.T) { diff --git a/test/smoketest/rotationdaily_test.go b/test/smoke/rotationdaily_test.go similarity index 96% rename from test/smoketest/rotationdaily_test.go rename to test/smoke/rotationdaily_test.go index beeada6c11..54573dae3b 100644 --- a/test/smoketest/rotationdaily_test.go +++ b/test/smoke/rotationdaily_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func TestRotation_Daily(t *testing.T) { diff --git a/test/smoketest/rotationdeluser_test.go b/test/smoke/rotationdeluser_test.go similarity index 95% rename from test/smoketest/rotationdeluser_test.go rename to test/smoke/rotationdeluser_test.go index ae8aebcb37..7ea7462eee 100644 --- a/test/smoketest/rotationdeluser_test.go +++ b/test/smoke/rotationdeluser_test.go @@ -1,11 +1,11 @@ -package smoketest +package smoke import ( "encoding/json" "fmt" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // RotationDelUser tests that rotations preserve the active user when a user is deleted. diff --git a/test/smoketest/rotationdst_test.go b/test/smoke/rotationdst_test.go similarity index 97% rename from test/smoketest/rotationdst_test.go rename to test/smoke/rotationdst_test.go index 533669119c..b22590df71 100644 --- a/test/smoketest/rotationdst_test.go +++ b/test/smoke/rotationdst_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func getLastDSTDate(t *testing.T, n time.Time, loc *time.Location) time.Time { diff --git a/test/smoketest/rotationgap_test.go b/test/smoke/rotationgap_test.go similarity index 95% rename from test/smoketest/rotationgap_test.go rename to test/smoke/rotationgap_test.go index 0c8026bc67..1da4227cf4 100644 --- a/test/smoketest/rotationgap_test.go +++ b/test/smoke/rotationgap_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func TestRotationGap(t *testing.T) { diff --git a/test/smoketest/rotationhourly_test.go b/test/smoke/rotationhourly_test.go similarity index 96% rename from test/smoketest/rotationhourly_test.go rename to test/smoke/rotationhourly_test.go index 3467aa9853..5c95186c5f 100644 --- a/test/smoketest/rotationhourly_test.go +++ b/test/smoke/rotationhourly_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func TestRotation_Hourly(t *testing.T) { diff --git a/test/smoketest/rotationweekly_test.go b/test/smoke/rotationweekly_test.go similarity index 96% rename from test/smoketest/rotationweekly_test.go rename to test/smoke/rotationweekly_test.go index 21ebe4ed0f..5cd2b0217f 100644 --- a/test/smoketest/rotationweekly_test.go +++ b/test/smoke/rotationweekly_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func TestRotation_Weekly(t *testing.T) { diff --git a/test/smoketest/rotationwrap_test.go b/test/smoke/rotationwrap_test.go similarity index 96% rename from test/smoketest/rotationwrap_test.go rename to test/smoke/rotationwrap_test.go index a576504501..d29fdfbbe3 100644 --- a/test/smoketest/rotationwrap_test.go +++ b/test/smoke/rotationwrap_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestRotation_Wrap checks that rotations wrap & repeat diff --git a/test/smoketest/schedulerule_test.go b/test/smoke/schedulerule_test.go similarity index 97% rename from test/smoketest/schedulerule_test.go rename to test/smoke/schedulerule_test.go index 2c882b0ad1..b0d2a134a6 100644 --- a/test/smoketest/schedulerule_test.go +++ b/test/smoke/schedulerule_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestScheduleRule performs the following checks: diff --git a/test/smoketest/servicemaintenancealert_test.go b/test/smoke/servicemaintenancealert_test.go similarity index 96% rename from test/smoketest/servicemaintenancealert_test.go rename to test/smoke/servicemaintenancealert_test.go index 5d4df18b7d..81953cc61f 100644 --- a/test/smoketest/servicemaintenancealert_test.go +++ b/test/smoke/servicemaintenancealert_test.go @@ -1,11 +1,11 @@ -package smoketest +package smoke import ( "fmt" "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestServiceMaintenanceAlert tests that an alert created for a user before diff --git a/test/smoketest/servicemaintenanceescalate_test.go b/test/smoke/servicemaintenanceescalate_test.go similarity index 97% rename from test/smoketest/servicemaintenanceescalate_test.go rename to test/smoke/servicemaintenanceescalate_test.go index c9096962bc..f08a119f55 100644 --- a/test/smoketest/servicemaintenanceescalate_test.go +++ b/test/smoke/servicemaintenanceescalate_test.go @@ -1,11 +1,11 @@ -package smoketest +package smoke import ( "fmt" "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestServiceMaintenanceEscalate tests creating and attempting diff --git a/test/smoketest/simplenotification_test.go b/test/smoke/simplenotification_test.go similarity index 98% rename from test/smoketest/simplenotification_test.go rename to test/smoke/simplenotification_test.go index da69f164f0..53c3b6ae83 100644 --- a/test/smoketest/simplenotification_test.go +++ b/test/smoke/simplenotification_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestSimpleNotifications tests that SMS and Voice goes out for diff --git a/test/smoketest/site24x7_test.go b/test/smoke/site24x7_test.go similarity index 96% rename from test/smoketest/site24x7_test.go rename to test/smoke/site24x7_test.go index 4de0cb84a8..f2b18cd247 100644 --- a/test/smoketest/site24x7_test.go +++ b/test/smoke/site24x7_test.go @@ -1,11 +1,11 @@ -package smoketest +package smoke import ( "bytes" "net/http" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func TestSite24x7(t *testing.T) { diff --git a/test/smoketest/slackaddtoepstep_test.go b/test/smoke/slackaddtoepstep_test.go similarity index 93% rename from test/smoketest/slackaddtoepstep_test.go rename to test/smoke/slackaddtoepstep_test.go index 564ecc8a7c..8e653e835e 100644 --- a/test/smoketest/slackaddtoepstep_test.go +++ b/test/smoke/slackaddtoepstep_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "fmt" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestSlackAddToEPStep tests that slack channels can be added to an EPStep. diff --git a/test/smoketest/slackchannels_test.go b/test/smoke/slackchannels_test.go similarity index 95% rename from test/smoketest/slackchannels_test.go rename to test/smoke/slackchannels_test.go index e72d118667..4ad6242434 100644 --- a/test/smoketest/slackchannels_test.go +++ b/test/smoke/slackchannels_test.go @@ -1,11 +1,11 @@ -package smoketest +package smoke import ( "encoding/json" "sort" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestSlackChannels tests that slack channels are returned for configured users. diff --git a/test/smoketest/slackinteraction_test.go b/test/smoke/slackinteraction_test.go similarity index 96% rename from test/smoketest/slackinteraction_test.go rename to test/smoke/slackinteraction_test.go index 0fca5c5c81..53d776851b 100644 --- a/test/smoketest/slackinteraction_test.go +++ b/test/smoke/slackinteraction_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestSlackInteraction checks that interactive slack messages work properly. diff --git a/test/smoketest/slacknotification_test.go b/test/smoke/slacknotification_test.go similarity index 93% rename from test/smoketest/slacknotification_test.go rename to test/smoke/slacknotification_test.go index 8eab44fc22..540c64a272 100644 --- a/test/smoketest/slacknotification_test.go +++ b/test/smoke/slacknotification_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestSlackNotification tests that slack channels are returned for configured users. diff --git a/test/smoketest/statusinprogress_test.go b/test/smoke/statusinprogress_test.go similarity index 96% rename from test/smoketest/statusinprogress_test.go rename to test/smoke/statusinprogress_test.go index def67b292e..526eca3f94 100644 --- a/test/smoketest/statusinprogress_test.go +++ b/test/smoke/statusinprogress_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestStatusInProgress ensures that sent and in-progress notifications for triggered alerts are honored through the migration. diff --git a/test/smoketest/statusupdates_test.go b/test/smoke/statusupdates_test.go similarity index 97% rename from test/smoketest/statusupdates_test.go rename to test/smoke/statusupdates_test.go index 6fdbd36361..ca245d92e5 100644 --- a/test/smoketest/statusupdates_test.go +++ b/test/smoke/statusupdates_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "bytes" @@ -6,7 +6,7 @@ import ( "net/url" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestStatusUpdates checks basic functionality of status updates: diff --git a/test/smoketest/statusupdatescancel_test.go b/test/smoke/statusupdatescancel_test.go similarity index 97% rename from test/smoketest/statusupdatescancel_test.go rename to test/smoke/statusupdatescancel_test.go index 606849f7b6..ef76963c34 100644 --- a/test/smoketest/statusupdatescancel_test.go +++ b/test/smoke/statusupdatescancel_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "bytes" @@ -7,7 +7,7 @@ import ( "net/url" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestStatusUpdatesCancel checks that status updates are unsubscribed when updates, or the contact method, are disabled. diff --git a/test/smoketest/statusupdateschannel_test.go b/test/smoke/statusupdateschannel_test.go similarity index 95% rename from test/smoketest/statusupdateschannel_test.go rename to test/smoke/statusupdateschannel_test.go index 8b768e164e..90fc5e60c2 100644 --- a/test/smoketest/statusupdateschannel_test.go +++ b/test/smoke/statusupdateschannel_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestStatusUpdatesChannel tests status updates to notification channels. diff --git a/test/smoketest/switchover_test.go b/test/smoke/switchover_test.go similarity index 85% rename from test/smoketest/switchover_test.go rename to test/smoke/switchover_test.go index d60d31689c..0e1897a993 100644 --- a/test/smoketest/switchover_test.go +++ b/test/smoke/switchover_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "context" @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/target/goalert/switchover/dbsync" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestDBSyncTables ensures the latest state of the database is compatible with the dbsync package. diff --git a/test/smoketest/systemlimits_test.go b/test/smoke/systemlimits_test.go similarity index 99% rename from test/smoketest/systemlimits_test.go rename to test/smoke/systemlimits_test.go index 7f580b277b..d291a52892 100644 --- a/test/smoketest/systemlimits_test.go +++ b/test/smoke/systemlimits_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "encoding/json" @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/target/goalert/limit" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestSystemLimits tests that limits are enforced if configured. diff --git a/test/smoketest/tempschedules_test.go b/test/smoke/tempschedules_test.go similarity index 97% rename from test/smoketest/tempschedules_test.go rename to test/smoke/tempschedules_test.go index 9fd655b01b..b2c1c178ce 100644 --- a/test/smoketest/tempschedules_test.go +++ b/test/smoke/tempschedules_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "fmt" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) func TestTempSchedules(t *testing.T) { diff --git a/test/smoketest/twilioenablebysms_test.go b/test/smoke/twilioenablebysms_test.go similarity index 96% rename from test/smoketest/twilioenablebysms_test.go rename to test/smoke/twilioenablebysms_test.go index 874b4473aa..c8760ab1a9 100644 --- a/test/smoketest/twilioenablebysms_test.go +++ b/test/smoke/twilioenablebysms_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "fmt" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioEnableBySMS checks that all contact methods with the same value and of the same user are enabled when the user responds via SMS with the correct code. diff --git a/test/smoketest/twilioenablebyvoice_test.go b/test/smoke/twilioenablebyvoice_test.go similarity index 96% rename from test/smoketest/twilioenablebyvoice_test.go rename to test/smoke/twilioenablebyvoice_test.go index 7505cb84a8..23f5767ad5 100644 --- a/test/smoketest/twilioenablebyvoice_test.go +++ b/test/smoke/twilioenablebyvoice_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "fmt" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioEnablebyVoice checks that all contact methods with the same value and of the same user are enabled when the user responds via Voice with the correct code. diff --git a/test/smoketest/twilioonewaysms_test.go b/test/smoke/twilioonewaysms_test.go similarity index 95% rename from test/smoketest/twilioonewaysms_test.go rename to test/smoke/twilioonewaysms_test.go index 8a8e828d16..5c022de756 100644 --- a/test/smoketest/twilioonewaysms_test.go +++ b/test/smoke/twilioonewaysms_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioOneWaySMS checks that two-way SMS can be disabled via config. diff --git a/test/smoketest/twiliosid_test.go b/test/smoke/twiliosid_test.go similarity index 96% rename from test/smoketest/twiliosid_test.go rename to test/smoke/twiliosid_test.go index 578c5c887f..7f5db330e6 100644 --- a/test/smoketest/twiliosid_test.go +++ b/test/smoke/twiliosid_test.go @@ -1,11 +1,11 @@ -package smoketest +package smoke import ( "testing" "time" "github.com/stretchr/testify/assert" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioSID checks that messages to SMS and Voice numbers work when using a Messaging Service SID for Twilio.FromNumber. diff --git a/test/smoketest/twiliosmsack_test.go b/test/smoke/twiliosmsack_test.go similarity index 95% rename from test/smoketest/twiliosmsack_test.go rename to test/smoke/twiliosmsack_test.go index dd53b4e917..84056dc6cf 100644 --- a/test/smoketest/twiliosmsack_test.go +++ b/test/smoke/twiliosmsack_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioSMSAck checks that an SMS ack message is processed. diff --git a/test/smoketest/twiliosmsclose_test.go b/test/smoke/twiliosmsclose_test.go similarity index 95% rename from test/smoketest/twiliosmsclose_test.go rename to test/smoke/twiliosmsclose_test.go index 15f00c8fb1..e4d0da380b 100644 --- a/test/smoketest/twiliosmsclose_test.go +++ b/test/smoke/twiliosmsclose_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioSMSClose checks that an SMS close message is processed. diff --git a/test/smoketest/twiliosmsfailure_test.go b/test/smoke/twiliosmsfailure_test.go similarity index 94% rename from test/smoketest/twiliosmsfailure_test.go rename to test/smoke/twiliosmsfailure_test.go index 22b5d103e1..5907ac85aa 100644 --- a/test/smoketest/twiliosmsfailure_test.go +++ b/test/smoke/twiliosmsfailure_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioSMSFailure checks that an SMS delivery failure is retried. diff --git a/test/smoketest/twiliosmsfromoverride_test.go b/test/smoke/twiliosmsfromoverride_test.go similarity index 96% rename from test/smoketest/twiliosmsfromoverride_test.go rename to test/smoke/twiliosmsfromoverride_test.go index bd31aa4e3f..aca81a943a 100644 --- a/test/smoketest/twiliosmsfromoverride_test.go +++ b/test/smoke/twiliosmsfromoverride_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioSMSFromOverride checks that the FromNumber of an SMS can be overridden per-carrier. diff --git a/test/smoketest/twiliosmsreplycode_test.go b/test/smoke/twiliosmsreplycode_test.go similarity index 95% rename from test/smoketest/twiliosmsreplycode_test.go rename to test/smoke/twiliosmsreplycode_test.go index bebe8cce05..a877d84aa3 100644 --- a/test/smoketest/twiliosmsreplycode_test.go +++ b/test/smoke/twiliosmsreplycode_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioSMSReplyCode checks that reply codes work properly. diff --git a/test/smoketest/twiliosmsreplyignore_test.go b/test/smoke/twiliosmsreplyignore_test.go similarity index 92% rename from test/smoketest/twiliosmsreplyignore_test.go rename to test/smoke/twiliosmsreplyignore_test.go index 793aacd516..cb16d3bc0d 100644 --- a/test/smoketest/twiliosmsreplyignore_test.go +++ b/test/smoke/twiliosmsreplyignore_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioSMSReplyIgnore checks that replies are dropped/ignored for unknown/disabled contact methods. diff --git a/test/smoketest/twiliosmsreplylast_test.go b/test/smoke/twiliosmsreplylast_test.go similarity index 95% rename from test/smoketest/twiliosmsreplylast_test.go rename to test/smoke/twiliosmsreplylast_test.go index b6e3cc951a..82be327e01 100644 --- a/test/smoketest/twiliosmsreplylast_test.go +++ b/test/smoke/twiliosmsreplylast_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioSMSReplyLast checks that an SMS reply message is processed with no number. diff --git a/test/smoketest/twiliosmsreplylimit_test.go b/test/smoke/twiliosmsreplylimit_test.go similarity index 95% rename from test/smoketest/twiliosmsreplylimit_test.go rename to test/smoke/twiliosmsreplylimit_test.go index 8b1ca69c97..97e4a97e99 100644 --- a/test/smoketest/twiliosmsreplylimit_test.go +++ b/test/smoke/twiliosmsreplylimit_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioSMSReplyLimit checks for a limit on passive replies (no action was taken due to error or already closed, etc). diff --git a/test/smoketest/twiliosmsstopstart_test.go b/test/smoke/twiliosmsstopstart_test.go similarity index 96% rename from test/smoketest/twiliosmsstopstart_test.go rename to test/smoke/twiliosmsstopstart_test.go index 9ce29ec749..c1067c58cc 100644 --- a/test/smoketest/twiliosmsstopstart_test.go +++ b/test/smoke/twiliosmsstopstart_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioSMSStopStart checks that SMS STOP and START messages are processed. diff --git a/test/smoketest/twiliosmstrailingspace_test.go b/test/smoke/twiliosmstrailingspace_test.go similarity index 94% rename from test/smoketest/twiliosmstrailingspace_test.go rename to test/smoke/twiliosmstrailingspace_test.go index 13a6b2ba01..c421e1e683 100644 --- a/test/smoketest/twiliosmstrailingspace_test.go +++ b/test/smoke/twiliosmstrailingspace_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioSMSTrailingSpace checks that an SMS ack message is processed even with trailing spaces in response. diff --git a/test/smoketest/twiliosmsurl_test.go b/test/smoke/twiliosmsurl_test.go similarity index 97% rename from test/smoketest/twiliosmsurl_test.go rename to test/smoke/twiliosmsurl_test.go index 79326a5f33..511e52b615 100644 --- a/test/smoketest/twiliosmsurl_test.go +++ b/test/smoke/twiliosmsurl_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "github.com/stretchr/testify/assert" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioURL_SMS checks that the GoAlert link in the SMS is correct diff --git a/test/smoketest/twiliosmsverification_test.go b/test/smoke/twiliosmsverification_test.go similarity index 95% rename from test/smoketest/twiliosmsverification_test.go rename to test/smoke/twiliosmsverification_test.go index 4d894e34cb..0846b9e16e 100644 --- a/test/smoketest/twiliosmsverification_test.go +++ b/test/smoke/twiliosmsverification_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "fmt" @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioSMSVerification checks that a verification SMS is processed. diff --git a/test/smoketest/twiliotestsms_test.go b/test/smoke/twiliotestsms_test.go similarity index 92% rename from test/smoketest/twiliotestsms_test.go rename to test/smoke/twiliotestsms_test.go index 4f82f3647b..f1d472a8b2 100644 --- a/test/smoketest/twiliotestsms_test.go +++ b/test/smoke/twiliotestsms_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "fmt" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioSMS checks that a test SMS is processed. diff --git a/test/smoketest/twiliotestvoice_test.go b/test/smoke/twiliotestvoice_test.go similarity index 92% rename from test/smoketest/twiliotestvoice_test.go rename to test/smoke/twiliotestvoice_test.go index 013e89c5d3..aa8fb02d27 100644 --- a/test/smoketest/twiliotestvoice_test.go +++ b/test/smoke/twiliotestvoice_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "fmt" "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioVoice checks that a test voice call is processed. diff --git a/test/smoketest/twiliovoiceack_test.go b/test/smoke/twiliovoiceack_test.go similarity index 95% rename from test/smoketest/twiliovoiceack_test.go rename to test/smoke/twiliovoiceack_test.go index c795b7f825..b8e5c05d27 100644 --- a/test/smoketest/twiliovoiceack_test.go +++ b/test/smoke/twiliovoiceack_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioVoiceAck checks that a voice call ack is processed. diff --git a/test/smoketest/twiliovoiceclose_test.go b/test/smoke/twiliovoiceclose_test.go similarity index 95% rename from test/smoketest/twiliovoiceclose_test.go rename to test/smoke/twiliovoiceclose_test.go index c4f5bfda74..8968cdc2ea 100644 --- a/test/smoketest/twiliovoiceclose_test.go +++ b/test/smoke/twiliovoiceclose_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioVoiceClose checks that a voice call close is processed. diff --git a/test/smoketest/twiliovoiceemptymessage_test.go b/test/smoke/twiliovoiceemptymessage_test.go similarity index 94% rename from test/smoketest/twiliovoiceemptymessage_test.go rename to test/smoke/twiliovoiceemptymessage_test.go index 622f4648c5..4ec3c4bb67 100644 --- a/test/smoketest/twiliovoiceemptymessage_test.go +++ b/test/smoke/twiliovoiceemptymessage_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioVoiceEmptyMessage checks that an appropriate voice call is made when alert has empty summary. diff --git a/test/smoketest/twiliovoicefailure_test.go b/test/smoke/twiliovoicefailure_test.go similarity index 94% rename from test/smoketest/twiliovoicefailure_test.go rename to test/smoke/twiliovoicefailure_test.go index 620e011be3..ca829a85e4 100644 --- a/test/smoketest/twiliovoicefailure_test.go +++ b/test/smoke/twiliovoicefailure_test.go @@ -1,9 +1,9 @@ -package smoketest +package smoke import ( "testing" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioVoiceFailure checks that a voice call failure is retried. diff --git a/test/smoketest/twiliovoicestop_test.go b/test/smoke/twiliovoicestop_test.go similarity index 95% rename from test/smoketest/twiliovoicestop_test.go rename to test/smoke/twiliovoicestop_test.go index ec8b43e5d9..ab4d1b80ac 100644 --- a/test/smoketest/twiliovoicestop_test.go +++ b/test/smoke/twiliovoicestop_test.go @@ -1,10 +1,10 @@ -package smoketest +package smoke import ( "testing" "time" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioVoiceStop checks that a voice call STOP is processed. diff --git a/test/smoketest/twiliovoiceverification_test.go b/test/smoke/twiliovoiceverification_test.go similarity index 97% rename from test/smoketest/twiliovoiceverification_test.go rename to test/smoke/twiliovoiceverification_test.go index 576d8d6f18..49ed60e0a3 100644 --- a/test/smoketest/twiliovoiceverification_test.go +++ b/test/smoke/twiliovoiceverification_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "fmt" @@ -8,7 +8,7 @@ import ( "time" "github.com/stretchr/testify/assert" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) // TestTwilioVoiceVerification checks that a verification voice call is processed. diff --git a/test/smoketest/upload.sh b/test/smoke/upload.sh similarity index 93% rename from test/smoketest/upload.sh rename to test/smoke/upload.sh index c2125be4df..d324f53200 100755 --- a/test/smoketest/upload.sh +++ b/test/smoke/upload.sh @@ -18,7 +18,7 @@ then echo "" for name in $FAILURES do - fname="test/smoketest/smoketest_db_dump/$NAME.sql" + fname="test/smoke/smoketest_db_dump/$NAME.sql" if [ -e "$fname" ] then FILE=$(curl -LksS "$SERVER/sql/" --data-binary "@$fname" -H "Authorization: Bearer $BUILD_IMAGE_SERVICE_TOKEN") diff --git a/test/smoketest/webhook_test.go b/test/smoke/webhook_test.go similarity index 96% rename from test/smoketest/webhook_test.go rename to test/smoke/webhook_test.go index a284febf82..aab3e1f4a4 100644 --- a/test/smoketest/webhook_test.go +++ b/test/smoke/webhook_test.go @@ -1,4 +1,4 @@ -package smoketest +package smoke import ( "encoding/json" @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/target/goalert/test/smoketest/harness" + "github.com/target/goalert/test/smoke/harness" ) type WebhookTestingAlert struct { From 24e9ebb9e2128c1a310444cf182b3e09ff552198 Mon Sep 17 00:00:00 2001 From: Nathaniel Caza Date: Thu, 25 Aug 2022 14:23:04 -0500 Subject: [PATCH 4/4] Update CONTRIBUTING.md Co-authored-by: Nathaniel Cook --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6587e93b9b..f8287ced03 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,4 +46,4 @@ GoAlert utilizes 3 main types of testing as tools for different purposes: - For backend code, a `_test.go` version of a file will contain relevant unit tests. More info [here](https://pkg.go.dev/testing) - For UI code, a `.test.ts` version of a file will contain relevant unit tests. More info [here](https://jestjs.io/docs/getting-started). - Smoke tests (in `test/smoke`) are used to ensure main functionality and things like behavioral compatibility with future versions & DB migrations. These focus on hard guarantees like deliverability and preserving intent as the application and datastore evolves and changes over time. -- Integration tests (currently under `web/src/cypress/integration`) are primarily used to validate happy-path flows work end-to-end, and any important/common error scenarios. They are focused on UX and high-level funcationality. +- Integration tests (currently under `web/src/cypress/integration`) are primarily used to validate happy-path flows work end-to-end, and any important/common error scenarios. They are focused on UX and high-level functionality.