1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

TESTING: Fix HE.DNS BYO-Secrets (#2221)

Co-authored-by: Tom Limoncelli <tal@whatexit.org>
This commit is contained in:
Tom Limoncelli
2023-03-24 04:43:57 -07:00
committed by GitHub
parent edf1b9fd50
commit 3bf78471e6
2 changed files with 9 additions and 22 deletions

View File

@ -90,11 +90,6 @@ jobs:
NAMEDOTCOM_URL: api.name.com NAMEDOTCOM_URL: api.name.com
NAMEDOTCOM_USER: dnscontroltest NAMEDOTCOM_USER: dnscontroltest
HEDNS_DOMAIN: dnscontrol.net
HEDNS_USERNAME: dnscontroltest
HEDNS_PASSWORD: $HEDNS_PASSWORD
HEDNS_TOTP_SECRET: $HEDNS_TOTP_SECRET
parameters: parameters:
provider: provider:
type: string type: string

View File

@ -51,7 +51,7 @@ only run if they have access to the secrets they will need.
Tests are executed if `*_DOMAIN` exists. If the value is empty or Tests are executed if `*_DOMAIN` exists. If the value is empty or
unset, the test is skipped. If a test doesn't require secrets, the unset, the test is skipped. If a test doesn't require secrets, the
`*_DOMAIN` variable is hardcoded. Otherwise, it is set by looking up `*_DOMAIN` variable is hardcoded so that it always runs. Otherwise, it is set by looking up
the secret. For example, if a provider is called `FANCYDNS`, there must the secret. For example, if a provider is called `FANCYDNS`, there must
be a secret called `FANCYDNS_DOMAIN`. be a secret called `FANCYDNS_DOMAIN`.
@ -68,13 +68,13 @@ Create a branch as you normally would to submit a PR to the project.
Step 2: Update `build.yml` Step 2: Update `build.yml`
In this branch, edit `.github/workflows/build.yml`: In this branch, edit `.circleci/config.yml`:
1. In the `integration-tests` section, add the name of your provider 1. In the `integration-tests` section, add the name of your provider
to the matrix of providers. Technically you are adding to the list to the matrix of providers. Technically you are adding to the list
at `jobs.integration-tests.strategy.matrix.provider`. at `workflows.build.jobs.integration-tests.matrix.parameters.provider`.
{% code title=".github/workflows/build.yml" %} {% code title=".circleci/config.yml" %}
```diff ```diff
matrix: matrix:
provider: provider:
@ -87,9 +87,8 @@ In this branch, edit `.github/workflows/build.yml`:
2. Add your test's env: 2. Add your test's env:
Locate the env section (technically this is `jobs.integration-tests.env`) and Also in `.circleci/config.yml`, locate the env section (technically `jobs.build.integration-tests.environment`) and
add all the env names that your provider sets in add any env variables that should be set by the project, not by an individual. Usually there is none.
`integrationTest/providers.json`.
Please replicate the formatting of the existing entries: Please replicate the formatting of the existing entries:
@ -99,9 +98,7 @@ Please replicate the formatting of the existing entries:
* The remaining variables are sorted lexicographically (what nerds call alphabetical order). * The remaining variables are sorted lexicographically (what nerds call alphabetical order).
```yaml ```yaml
FANCYDNS_DOMAIN: ${{ secrets.FANCYDNS_DOMAIN }} FANCYDNS_THING: myvalue
FANCYDNS_KEY: ${{ secrets.FANCYDNS_KEY }}
FANCYDNS_USER: ${{ secrets.FANCYDNS_USER }}
``` ```
# Examples # Examples
@ -128,20 +125,15 @@ that the tests will skip if the PR does not have access to the
secrets. secrets.
If you have a fork and want to automate the testing of `AZURE_DNS`, If you have a fork and want to automate the testing of `AZURE_DNS`,
simply set the secrets named in `build.yml` and the tests will simply set the secrets named in `.circleci/config.yml` and the tests will
activate for your PRs. activate for your PRs.
Note that `AZURE_DNS_RESOURCE_GROUP` is hardcoded to `DNSControl`. If Note that `AZURE_DNS_RESOURCE_GROUP` is hardcoded to `DNSControl`. If
this is not true for you, please feel free to submit a PR that turns this is not true for you, please feel free to submit a PR that turns
it into a secret. it into a variable.
```yaml ```yaml
AZURE_DNS_DOMAIN: ${{ secrets.AZURE_DNS_DOMAIN }}
AZURE_DNS_CLIENT_ID: ${{ secrets.AZURE_DNS_CLIENT_ID }}
AZURE_DNS_CLIENT_SECRET: ${{ secrets.AZURE_DNS_CLIENT_SECRET }}
AZURE_DNS_RESOURCE_GROUP: DNSControl AZURE_DNS_RESOURCE_GROUP: DNSControl
AZURE_DNS_SUBSCRIPTION_ID: ${{ secrets.AZURE_DNS_SUBSCRIPTION_ID }}
AZURE_DNS_TENANT_ID: ${{ secrets.AZURE_DNS_TENANT_ID }}
``` ```
## Example 3 ## Example 3