From 75de0b5aa217ac085a5bbabd6c9167ee28d1f6eb Mon Sep 17 00:00:00 2001 From: Yann CRUMEYROLLE Date: Mon, 15 Jul 2019 00:41:37 +0200 Subject: [PATCH] Try to fix benchmark using https://github.com/dotnet/BenchmarkDotNet/issues/837 --- perf/Benchmarks/ValidateEncryptedToken.cs | 3 ++- perf/Benchmarks/ValidateSignedToken.cs | 3 ++- perf/Benchmarks/ValidateUnsignedToken.cs | 3 ++- perf/Benchmarks/WriteEncryptedToken.cs | 3 ++- perf/Benchmarks/WriteSignedToken.cs | 3 ++- perf/Benchmarks/WriteUnsignedToken.cs | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/perf/Benchmarks/ValidateEncryptedToken.cs b/perf/Benchmarks/ValidateEncryptedToken.cs index bf0331724..b7fa9c1f2 100644 --- a/perf/Benchmarks/ValidateEncryptedToken.cs +++ b/perf/Benchmarks/ValidateEncryptedToken.cs @@ -8,7 +8,8 @@ namespace JsonWebToken.Performance [BenchmarkCategory("CI-CD")] public class ValidateEncryptedToken : ValidateToken { - public ValidateEncryptedToken() + [GlobalSetup] + public void Setup() { Jwt("JWE-empty"); Wilson("JWE-empty"); diff --git a/perf/Benchmarks/ValidateSignedToken.cs b/perf/Benchmarks/ValidateSignedToken.cs index bd3b28c60..570e10ac1 100644 --- a/perf/Benchmarks/ValidateSignedToken.cs +++ b/perf/Benchmarks/ValidateSignedToken.cs @@ -8,7 +8,8 @@ namespace JsonWebToken.Performance [BenchmarkCategory("CI-CD")] public class ValidateSignedToken : ValidateToken { - public ValidateSignedToken() + [GlobalSetup] + public void Setup() { Jwt("JWS-empty"); Wilson("JWS-empty"); diff --git a/perf/Benchmarks/ValidateUnsignedToken.cs b/perf/Benchmarks/ValidateUnsignedToken.cs index bb0602d43..f1cdb90db 100644 --- a/perf/Benchmarks/ValidateUnsignedToken.cs +++ b/perf/Benchmarks/ValidateUnsignedToken.cs @@ -8,7 +8,8 @@ namespace JsonWebToken.Performance [BenchmarkCategory("CI-CD")] public class ValidateUnsignedToken : ValidateToken { - public ValidateUnsignedToken() + [GlobalSetup] + public void Setup() { Jwt("JWT-empty"); Wilson("JWT-empty"); diff --git a/perf/Benchmarks/WriteEncryptedToken.cs b/perf/Benchmarks/WriteEncryptedToken.cs index cb8fff735..a886e41ac 100644 --- a/perf/Benchmarks/WriteEncryptedToken.cs +++ b/perf/Benchmarks/WriteEncryptedToken.cs @@ -7,7 +7,8 @@ namespace JsonWebToken.Performance [BenchmarkCategory("CI-CD")] public class WriteEncryptedToken : WriteToken { - public WriteEncryptedToken() + [GlobalSetup] + public void Setup() { Jwt("JWE-empty"); Wilson("JWE-empty"); diff --git a/perf/Benchmarks/WriteSignedToken.cs b/perf/Benchmarks/WriteSignedToken.cs index 007e99853..591a1fa8c 100644 --- a/perf/Benchmarks/WriteSignedToken.cs +++ b/perf/Benchmarks/WriteSignedToken.cs @@ -7,7 +7,8 @@ namespace JsonWebToken.Performance [BenchmarkCategory("CI-CD")] public class WriteSignedToken : WriteToken { - public WriteSignedToken() + [GlobalSetup] + public void Setup() { Jwt("JWS-empty"); Wilson("JWS-empty"); diff --git a/perf/Benchmarks/WriteUnsignedToken.cs b/perf/Benchmarks/WriteUnsignedToken.cs index c8bb408a6..e7c1ae9e7 100644 --- a/perf/Benchmarks/WriteUnsignedToken.cs +++ b/perf/Benchmarks/WriteUnsignedToken.cs @@ -7,7 +7,8 @@ namespace JsonWebToken.Performance [BenchmarkCategory("CI-CD")] public class WriteUnsignedToken : WriteToken { - public WriteUnsignedToken() + [GlobalSetup] + public void Setup() { Jwt("JWT-empty"); Wilson("JWT-empty");