From 790b1fa130a4c49864474fc736a5c9085cb1da51 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 22 Jul 2021 14:18:11 +0000 Subject: [PATCH] feat: add Samples section to CONTRIBUTING.rst (#97) Source-Link: https://github.com/googleapis/synthtool/commit/52e4e46eff2a0b70e3ff5506a02929d089d077d4 Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:6186535cbdbf6b9fe61f00294929221d060634dae4a0795c1cefdbc995b2d605 --- .../.github/.OwlBot.lock.yaml | 2 +- .../google-cloud-os-config/CONTRIBUTING.rst | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-os-config/.github/.OwlBot.lock.yaml b/packages/google-cloud-os-config/.github/.OwlBot.lock.yaml index cb06536dab0b..d57f74204625 100644 --- a/packages/google-cloud-os-config/.github/.OwlBot.lock.yaml +++ b/packages/google-cloud-os-config/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:5ff7446edeaede81c3ed58b23a4e76a5403fba1350ce28478045657303b6479d + digest: sha256:6186535cbdbf6b9fe61f00294929221d060634dae4a0795c1cefdbc995b2d605 diff --git a/packages/google-cloud-os-config/CONTRIBUTING.rst b/packages/google-cloud-os-config/CONTRIBUTING.rst index 888804e419f3..db5f076bd594 100644 --- a/packages/google-cloud-os-config/CONTRIBUTING.rst +++ b/packages/google-cloud-os-config/CONTRIBUTING.rst @@ -177,6 +177,30 @@ Build the docs via: $ nox -s docs +************************* +Samples and code snippets +************************* + +Code samples and snippets live in the `samples/` catalogue. Feel free to +provide more examples, but make sure to write tests for those examples. +Each folder containing example code requires its own `noxfile.py` script +which automates testing. If you decide to create a new folder, you can +base it on the `samples/snippets` folder (providing `noxfile.py` and +the requirements files). + +The tests will run against a real Google Cloud Project, so you should +configure them just like the System Tests. + +- To run sample tests, you can execute:: + + # Run all tests in a folder + $ cd samples/snippets + $ nox -s py-3.8 + + # Run a single sample test + $ cd samples/snippets + $ nox -s py-3.8 -- -k + ******************************************** Note About ``README`` as it pertains to PyPI ********************************************