daml/libs-scala
Claudio Bley e766f91338
Generate CSV file from all test evidences for ledger client components (#15372)
* Add new security categories

* Use test-security framework for OAuth2 middleware

* Regenerate `security-evidence.md`

* Explicitely exit the test-evidence generator

* Use test-security framework for HTTP JSON

* Regenerate `security-evidence.md`

* Add //ledger-service/http-json:integration-tests-lib to evidence generator

* Skip maven artefacts on the classpath

The checker framework artefact (`checker-2.5.4.jar`) causes an `IllegalAccessError` when included in the runpath:
```
Exception in thread "main" java.lang.IllegalAccessError: class com.sun.tools.javac.code.Scope$ImportScope$ImportEntry cannot access its superclass com.sun.tools.javac.code.Scope$Entry (com.sun.tools.javac.code.Scope$ImportScope$ImportEntry is in unnamed module of loader java.net.URLClassLoader @31000e60; com.sun.tools.javac.code.Scope$Entry is in module jdk.compiler of loader app)
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
	at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:550)
	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:458)
	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:452)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:451)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at org.scalatest.tools.SuiteDiscoveryHelper$.isDiscoverableSuite(SuiteDiscoveryHelper.scala:204)
	at org.scalatest.tools.SuiteDiscoveryHelper$.processClassName(SuiteDiscoveryHelper.scala:243)
	at org.scalatest.tools.SuiteDiscoveryHelper$.$anonfun$processFileNames$1(SuiteDiscoveryHelper.scala:279)
	at scala.collection.Iterator$$anon$9.next(Iterator.scala:577)
	at scala.collection.Iterator$$anon$6.hasNext(Iterator.scala:474)
	at scala.collection.Iterator$$anon$9.hasNext(Iterator.scala:576)
	at scala.collection.immutable.List.prependedAll(List.scala:152)
	at scala.collection.immutable.List$.from(List.scala:684)
	at scala.collection.immutable.List$.from(List.scala:681)
	at scala.collection.IterableFactory$Delegate.from(Factory.scala:288)
	at scala.collection.immutable.Iterable$.from(Iterable.scala:35)
	at scala.collection.immutable.Iterable$.from(Iterable.scala:32)
	at scala.collection.IterableFactory$Delegate.from(Factory.scala:288)
	at scala.collection.IterableOnceExtensionMethods$.toIterable$extension(IterableOnce.scala:178)
	at org.scalatest.tools.SuiteDiscoveryHelper$.processFileNames(SuiteDiscoveryHelper.scala:285)
	at org.scalatest.tools.SuiteDiscoveryHelper$.$anonfun$discoverSuiteNames$1(SuiteDiscoveryHelper.scala:132)
	at scala.collection.immutable.List.map(List.scala:250)
```

* Regenerate `security-evidence.md`

* Convert remaining TEST_EVIDENCE stanzas of HTTP JSON

* Regenerate `security-evidence.md`

* Use test-security framework for HTTP JSON

* Regenerate `security-evidence.md`

* Print warning when a test suite could not be loaded

* Fix typo

* Use test-security framework for HTTP JSON

* Read files in tests lazily

The test-evidence generator tool needs to instantiate scalatest test suites in order
to access the tagged tests and collect relavant test entries.

* Use test-security framework for HTTP JSON

* Regenerate `security-evidence.md`

* Regenerate `security-evidence.md`

* Use test-security framework for HTTP JSON

* Regenerate `security-evidence.md`

* Use test-security framework for HTTP JSON

* Regenerate `security-evidence.md`

* Use test-security framework for HTTP JSON

* Regenerate `security-evidence.md`

* Use test-security framework for trigger service

* Use structural type to call `in` and `ignore` for different classes

* Remove Authentication category from EvidenceSecurity tool

There are no TEST_EVIDENCE annotations anymore.

* Add required trigger-runner-lib


* Import `scala.language.reflectiveCalls` where it is needed

* Remove left-over comments

* Add `test_evidence_binary` scala binary rule

This rule is a customized `scala_binary` rule which also accepts a `tests` attr and
generates a runpath file which is later consumed by scalatest to detect the relevant
scalatest test suites.

* Process test suites, add transitive deps

* Support nested tests_suites in `test_evidence_binary`

* Remove debug print's

* Add missing dependencies to test-evidence:generator

* Abort if test suites cannot be loaded

* Cleanup

* Reinstate scalacopts in http-json

* Reword the test description to not drop information

* Fix typo

* Explicitly exit the JVM on exceptions

This is required since non-daemon threads also prevent JVM shutdown when an exception was thrown.

* Format test-evidence/BUILD.bazel

* Resolve file paths lazily

This avoids a `NullPointerException` on Windows where Runfiles.rlocation returns `null`.

* Document new Security properties

* Print target directory and file name

* Clarify test descriptions

* Replace duplicate Security properties

Co-authored-by: Stephen Compall <stephen.compall@daml.com>Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2022-11-29 12:35:22 +01:00
..
adjustable-clock update copyright headers (#12240) 2022-01-03 16:36:51 +00:00
auth-utils update copyright headers (#12240) 2022-01-03 16:36:51 +00:00
build-info update copyright headers (#12240) 2022-01-03 16:36:51 +00:00
concurrent update copyright headers (#12240) 2022-01-03 16:36:51 +00:00
contextualized-logging Added logging for time elapsed of ledger client call (#14711) 2022-08-22 21:14:38 +01:00
crypto Update scalafmt to 3.5.1. (#13584) 2022-04-28 09:57:04 +00:00
db-utils Replace silencer plugin with built-in warning configuration (#12543) 2022-01-24 15:01:35 +00:00
doobie-slf4j update copyright headers (#12240) 2022-01-03 16:36:51 +00:00
flyway-testing Naming and logging improvements [DPP-956] (#13270) 2022-03-15 09:40:39 +01:00
fs-utils ledger/cli-opts: Add tests for --auth-* CLI parameters. (#12894) 2022-02-11 19:42:21 +01:00
gatling-utils Revert "Upgrade dependencies to their latest stable release (#15216)" (#15309) 2022-10-24 08:33:37 +02:00
grpc-reverse-proxy update copyright headers (#12240) 2022-01-03 16:36:51 +00:00
grpc-server-reflection-client update copyright headers (#12240) 2022-01-03 16:36:51 +00:00
grpc-test-utils update copyright headers (#12240) 2022-01-03 16:36:51 +00:00
grpc-utils Simplify implementations of BaseError trait [DPP-606] (#13185) 2022-03-10 12:12:14 +01:00
jwt Generate CSV file from all test evidences for ledger client components (#15372) 2022-11-29 12:35:22 +01:00
logging-entries update copyright headers (#12240) 2022-01-03 16:36:51 +00:00
nameof Replace silencer plugin with built-in warning configuration (#12543) 2022-01-24 15:01:35 +00:00
nonempty Sort on NE should preserve NE (#14958) 2022-09-07 15:13:27 +02:00
nonempty-cats add cats' functor instance for NonEmptyF (#14403) 2022-07-13 18:23:05 +00:00
oracle-testing [DPP-1327] Migration tests for upcoming ETQ changes and support for Oracle (#15694) 2022-11-28 13:54:43 +01:00
ports fix eta-expansion and nullary method warnings [DPP-1281] (#15689) 2022-11-24 12:28:41 +00:00
postgresql-testing [DPP-1327] Migration tests for upcoming ETQ changes and support for Oracle (#15694) 2022-11-28 13:54:43 +01:00
resources fix eta-expansion and nullary method warnings [DPP-1281] (#15689) 2022-11-24 12:28:41 +00:00
resources-akka update copyright headers (#12240) 2022-01-03 16:36:51 +00:00
resources-grpc update copyright headers (#12240) 2022-01-03 16:36:51 +00:00
safe-proto LF: Imporve safety of the Serialization of proto message. (#12686) 2022-02-01 15:45:17 +01:00
scala-utils Update scalafmt to 3.5.1. (#13584) 2022-04-28 09:57:04 +00:00
scalatest-utils update copyright headers (#12240) 2022-01-03 16:36:51 +00:00
struct-json Add libs-scala/struct-json (#15090) 2022-09-29 16:22:01 +01:00
test-evidence Generate CSV file from all test evidences for ledger client components (#15372) 2022-11-29 12:35:22 +01:00
timer-utils Check if package metadata view initialisation takes too long [DPP-1160] (#14782) 2022-08-24 05:59:10 +00:00