socketry / cloudflare

An asynchronous Ruby wrapper for the CloudFlare V4 API.
138 stars 86 forks source link

Equivalent of `TRAVIS_JOB_ID`? #61

Open ioquatix opened 4 years ago

ioquatix commented 4 years ago

@bryanmacfarlane This test suite is very tricky to run because Cloudflare do not provide a testing environment.

Each test run must use a unique hostname as the root for running tests, e.g. adding DNS records, firewall rules, etc.

In travis, each job is sequentially assigned a JOB ID, e.g. if the matrix has 8 entries, there will be JOB IDs 1..8 inclusive.

Is there such an equivalent for GitHub Actions? e.g. GITHUB_JOB_ID which would be 1 for the first matrix permutation, 2, for the next one, etc.

Or do you have some other idea how to make this work?

ioquatix commented 4 years ago

I tried generating random hostnames using INVOCATION_ID but Cloudflare checks the domains are actually registered, so we need to actually select from a subset of registered domain names, i.e. "ci-#{ENV['INVOCATION_ID']}.com" won't work - which otherwise would have been really convenient.