Socket
Socket
Sign inDemoInstall

github.com/GoogleCloudPlatform/golang-samples/testing/sampletests

Package Overview
Dependencies
3
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/GoogleCloudPlatform/golang-samples/testing/sampletests

The sampletests command adds the region tags tested by each test to the XML properties of that test case. It reads JUnit XML from stdin and writes JUnit XML to stdout. For example, if TestFoo tests the regions foo_hello_world and foo_hello_gopher, the TestFoo element will have the following property: sampletests only looks at direct function calls or references by tests. So, if you have a map from string -> function reference in the global scope and test functions only reference the string, sampletests will not work. There are some duplicate region tags, but they aren't tracked anywhere else, so it's OK if they are "applied" to more than one test. sampletests only looks in the current module, which matches the behavior of `go test`. So, if you run `go test ./...` and sampletests in the same directory they should both find the same set of packages. The test coverage over all regions is printed to stderr at the end. The coverage is based on the entire module, not just the tests that happen to be in the given XML input. The XML may not be for for all tests in the module. Warnings are printed to stderr for invalid region tags (e.g. mis-matched START and END tags). The -enable_xml flag can be used to disable XML processing and only print warnings and coverage. To get the number of unique region tags in the repo manually, run:


Version published

FAQs

Last updated on 10 Aug 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc