Skip to content

Commit

Permalink
テストコードをライセンス期限とシステム時間に対応する
Browse files Browse the repository at this point in the history
  • Loading branch information
tnamao committed Feb 7, 2024
1 parent 4b4cbf0 commit 0e62b42
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ func TestInvalidConfig(t *testing.T) {
URI: s.URL,
SkipSslVerify: true,
Timeout: timeout,
FreezeTimeSeconds: true,
Logger: log.NewNopLogger(),
EnableSoraClientMetrics: true,
EnableSoraConnectionErrorMetrics: true,
Expand All @@ -298,6 +299,7 @@ func TestMaximumMetrics(t *testing.T) {
URI: s.URL,
SkipSslVerify: true,
Timeout: timeout,
FreezeTimeSeconds: true,
Logger: log.NewNopLogger(),
EnableSoraClientMetrics: true,
EnableSoraConnectionErrorMetrics: true,
Expand All @@ -316,6 +318,7 @@ func TestSoraErlangVMEnabledMetrics(t *testing.T) {
URI: s.URL,
SkipSslVerify: true,
Timeout: timeout,
FreezeTimeSeconds: true,
Logger: log.NewNopLogger(),
EnableSoraClientMetrics: false,
EnableSoraConnectionErrorMetrics: false,
Expand All @@ -334,6 +337,7 @@ func TestSoraClientEnabledMetrics(t *testing.T) {
URI: s.URL,
SkipSslVerify: true,
Timeout: timeout,
FreezeTimeSeconds: true,
Logger: log.NewNopLogger(),
EnableSoraClientMetrics: true,
EnableSoraConnectionErrorMetrics: false,
Expand All @@ -352,6 +356,7 @@ func TestSoraConnectionErrorEnabledMetrics(t *testing.T) {
URI: s.URL,
SkipSslVerify: true,
Timeout: timeout,
FreezeTimeSeconds: true,
Logger: log.NewNopLogger(),
EnableSoraClientMetrics: false,
EnableSoraConnectionErrorMetrics: true,
Expand Down Expand Up @@ -395,6 +400,7 @@ func TestMinimumMetrics(t *testing.T) {
URI: s.URL,
SkipSslVerify: true,
Timeout: timeout,
FreezeTimeSeconds: true,
Logger: log.NewNopLogger(),
EnableSoraClientMetrics: false,
EnableSoraConnectionErrorMetrics: false,
Expand All @@ -413,6 +419,7 @@ func TestSoraClusterEnabledMetrics(t *testing.T) {
URI: s.URL,
SkipSslVerify: true,
Timeout: timeout,
FreezeTimeSeconds: true,
Logger: log.NewNopLogger(),
EnableSoraClientMetrics: false,
EnableSoraConnectionErrorMetrics: false,
Expand All @@ -432,6 +439,7 @@ func TestSoraClusterEnabledMetricsCurrentJsonData(t *testing.T) {
URI: s.URL,
SkipSslVerify: true,
Timeout: timeout,
FreezeTimeSeconds: true,
Logger: log.NewNopLogger(),
EnableSoraClientMetrics: false,
EnableSoraConnectionErrorMetrics: false,
Expand Down
6 changes: 6 additions & 0 deletions test/maximum.metrics
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ sora_erlang_vm_wall_clock_wallclock_time_since_last_call 9090
# TYPE sora_event_webhook_total counter
sora_event_webhook_total{state="failed"} 94
sora_event_webhook_total{state="successful"} 97
# HELP sora_license_expired_at_timestamp_seconds sora license file's expired at.
# TYPE sora_license_expired_at_timestamp_seconds gauge
sora_license_expired_at_timestamp_seconds 1.759276799e+09
# HELP sora_license_info sora license info.
# TYPE sora_license_info gauge
sora_license_info{expired_at="2025-09",product_name="Sora",serial_code="EXPORTER-SRA-E001-202509-N10-100",type="Experimental"} 1
Expand Down Expand Up @@ -174,6 +177,9 @@ sora_session_webhook_total{state="successful"} 98
# TYPE sora_successful_auth_webhook_total counter
sora_successful_auth_webhook_total{state="allowed"} 91
sora_successful_auth_webhook_total{state="denied"} 92
# HELP sora_time_seconds HELP time_seconds System time in seconds since epoch.
# TYPE sora_time_seconds gauge
sora_time_seconds 1.7046492910003123e+09
# HELP sora_turn_connections_total The total number of connections with TURN.
# TYPE sora_turn_connections_total counter
sora_turn_connections_total{proto="tcp"} 2
Expand Down
6 changes: 6 additions & 0 deletions test/minimum.metrics
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ sora_duration_seconds_total 1412
# TYPE sora_event_webhook_total counter
sora_event_webhook_total{state="failed"} 94
sora_event_webhook_total{state="successful"} 97
# HELP sora_license_expired_at_timestamp_seconds sora license file's expired at.
# TYPE sora_license_expired_at_timestamp_seconds gauge
sora_license_expired_at_timestamp_seconds 1.759276799e+09
# HELP sora_license_info sora license info.
# TYPE sora_license_info gauge
sora_license_info{expired_at="2025-09",product_name="Sora",serial_code="EXPORTER-SRA-E001-202509-N10-100",type="Experimental"} 1
Expand All @@ -46,6 +49,9 @@ sora_session_webhook_total{state="successful"} 98
# TYPE sora_successful_auth_webhook_total counter
sora_successful_auth_webhook_total{state="allowed"} 91
sora_successful_auth_webhook_total{state="denied"} 92
# HELP sora_time_seconds HELP time_seconds System time in seconds since epoch.
# TYPE sora_time_seconds gauge
sora_time_seconds 1.7046492910003123e+09
# HELP sora_turn_connections_total The total number of connections with TURN.
# TYPE sora_turn_connections_total counter
sora_turn_connections_total{proto="tcp"} 444
Expand Down
6 changes: 6 additions & 0 deletions test/sora_client_enabled.metrics
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ sora_duration_seconds_total 1412
# TYPE sora_event_webhook_total counter
sora_event_webhook_total{state="failed"} 94
sora_event_webhook_total{state="successful"} 97
# HELP sora_license_expired_at_timestamp_seconds sora license file's expired at.
# TYPE sora_license_expired_at_timestamp_seconds gauge
sora_license_expired_at_timestamp_seconds 1.759276799e+09
# HELP sora_license_info sora license info.
# TYPE sora_license_info gauge
sora_license_info{expired_at="2025-09",product_name="Sora",serial_code="EXPORTER-SRA-E001-202509-N10-100",type="Experimental"} 1
Expand Down Expand Up @@ -75,6 +78,9 @@ sora_session_webhook_total{state="successful"} 98
# TYPE sora_successful_auth_webhook_total counter
sora_successful_auth_webhook_total{state="allowed"} 91
sora_successful_auth_webhook_total{state="denied"} 92
# HELP sora_time_seconds HELP time_seconds System time in seconds since epoch.
# TYPE sora_time_seconds gauge
sora_time_seconds 1.7046492910003123e+09
# HELP sora_turn_connections_total The total number of connections with TURN.
# TYPE sora_turn_connections_total counter
sora_turn_connections_total{proto="tcp"} 2
Expand Down
6 changes: 6 additions & 0 deletions test/sora_cluster_metrics_enabled.metrics
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ sora_duration_seconds_total 1412
# TYPE sora_event_webhook_total counter
sora_event_webhook_total{state="failed"} 94
sora_event_webhook_total{state="successful"} 97
# HELP sora_license_expired_at_timestamp_seconds sora license file's expired at.
# TYPE sora_license_expired_at_timestamp_seconds gauge
sora_license_expired_at_timestamp_seconds 1.759276799e+09
# HELP sora_license_info sora license info.
# TYPE sora_license_info gauge
sora_license_info{expired_at="2025-09",product_name="Sora",serial_code="EXPORTER-SRA-E001-202509-N10-100",type="Experimental"} 1
Expand Down Expand Up @@ -63,6 +66,9 @@ sora_session_webhook_total{state="successful"} 98
# TYPE sora_successful_auth_webhook_total counter
sora_successful_auth_webhook_total{state="allowed"} 91
sora_successful_auth_webhook_total{state="denied"} 92
# HELP sora_time_seconds HELP time_seconds System time in seconds since epoch.
# TYPE sora_time_seconds gauge
sora_time_seconds 1.7046492910003123e+09
# HELP sora_turn_connections_total The total number of connections with TURN.
# TYPE sora_turn_connections_total counter
sora_turn_connections_total{proto="tcp"} 2
Expand Down
6 changes: 6 additions & 0 deletions test/sora_connection_error_enabled.metrics
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ sora_duration_seconds_total 1412
# TYPE sora_event_webhook_total counter
sora_event_webhook_total{state="failed"} 94
sora_event_webhook_total{state="successful"} 97
# HELP sora_license_expired_at_timestamp_seconds sora license file's expired at.
# TYPE sora_license_expired_at_timestamp_seconds gauge
sora_license_expired_at_timestamp_seconds 1.759276799e+09
# HELP sora_license_info sora license info.
# TYPE sora_license_info gauge
sora_license_info{expired_at="2025-09",product_name="Sora",serial_code="EXPORTER-SRA-E001-202509-N10-100",type="Experimental"} 1
Expand Down Expand Up @@ -53,6 +56,9 @@ sora_session_webhook_total{state="successful"} 98
# TYPE sora_successful_auth_webhook_total counter
sora_successful_auth_webhook_total{state="allowed"} 91
sora_successful_auth_webhook_total{state="denied"} 92
# HELP sora_time_seconds HELP time_seconds System time in seconds since epoch.
# TYPE sora_time_seconds gauge
sora_time_seconds 1.7046492910003123e+09
# HELP sora_turn_connections_total The total number of connections with TURN.
# TYPE sora_turn_connections_total counter
sora_turn_connections_total{proto="tcp"} 2
Expand Down
6 changes: 6 additions & 0 deletions test/sora_erlang_vm_enabled.metrics
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ sora_erlang_vm_wall_clock_wallclock_time_since_last_call 9090
# TYPE sora_event_webhook_total counter
sora_event_webhook_total{state="failed"} 94
sora_event_webhook_total{state="successful"} 97
# HELP sora_license_expired_at_timestamp_seconds sora license file's expired at.
# TYPE sora_license_expired_at_timestamp_seconds gauge
sora_license_expired_at_timestamp_seconds 1.759276799e+09
# HELP sora_license_info sora license info.
# TYPE sora_license_info gauge
sora_license_info{expired_at="2025-09",product_name="Sora",serial_code="EXPORTER-SRA-E001-202509-N10-100",type="Experimental"} 1
Expand Down Expand Up @@ -130,6 +133,9 @@ sora_session_webhook_total{state="successful"} 98
# TYPE sora_successful_auth_webhook_total counter
sora_successful_auth_webhook_total{state="allowed"} 91
sora_successful_auth_webhook_total{state="denied"} 92
# HELP sora_time_seconds HELP time_seconds System time in seconds since epoch.
# TYPE sora_time_seconds gauge
sora_time_seconds 1.7046492910003123e+09
# HELP sora_turn_connections_total The total number of connections with TURN.
# TYPE sora_turn_connections_total counter
sora_turn_connections_total{proto="tcp"} 2
Expand Down

0 comments on commit 0e62b42

Please sign in to comment.