Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add peering_commontopo tests [NET-3700] #17951

Merged
merged 105 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
c3771f6
Initial commit
rboyer Mar 16, 2023
b447f2f
add readme
rboyer Mar 30, 2023
bc68175
moving cli sample
rboyer Mar 30, 2023
9b86b85
only pick servers that have been provisioned
rboyer Mar 30, 2023
836d946
temporarily remove squid error hiding
rboyer Apr 14, 2023
d9bcfb4
fix the test cleanup to correctly be able to cleanup stale docker res…
rboyer Apr 14, 2023
48a52d1
suggestion to rename Node to Pod to be clearer it isn't a catalog node
rboyer Apr 14, 2023
a69af94
intercept signals to politely tear down sample app
rboyer Apr 20, 2023
3e1d43b
fix networking a bit
rboyer Apr 20, 2023
e23f751
actually retry networking setup
rboyer Apr 21, 2023
99e543c
relaunch is easier to understand
rboyer Apr 21, 2023
33b7a45
wait until peering is established and ready before returning
rboyer Apr 21, 2023
4e1c827
details
rboyer Apr 21, 2023
a194786
fix env vars
rboyer Apr 21, 2023
c9e0c2e
tweaking the test integration
rboyer Apr 21, 2023
bc6ccf2
capture container logs on failure
rboyer Apr 21, 2023
b9c4c2e
add more helper logic
rboyer Apr 24, 2023
83af6e2
some ux improvements
rboyer Apr 24, 2023
5220db1
thread context through
rboyer Apr 24, 2023
8324ccf
retry certain errors
rboyer Apr 24, 2023
1dc399a
typo
rboyer Apr 24, 2023
f70f520
ux improvements
rboyer Apr 25, 2023
879ef9e
clean up squid errors more
rboyer Apr 25, 2023
7f3590c
adding envoy snapshot capture
rboyer Apr 25, 2023
5143abc
switch the forward proxy from squid to nginx b/c the error messages a…
rboyer Apr 25, 2023
507ca61
forgot to exit early
rboyer Apr 25, 2023
a8c33e8
fix this to work properly now
rboyer Apr 25, 2023
dbf909a
fix lint
rboyer Apr 25, 2023
6f1a9cd
enhance errors
rboyer Apr 26, 2023
674ae98
bump versions
rboyer Apr 26, 2023
1c5de35
fix some partition bugs
rboyer Apr 26, 2023
47f52ec
denormalizing peering metadata on upstreams too
rboyer Apr 26, 2023
61c7ed8
remove protocol as it wasn't being used and may have been misleading
rboyer Apr 26, 2023
6720885
tweak forward proxy defaults
rboyer Apr 26, 2023
a94f47d
work around unreleased bug
rboyer Apr 28, 2023
5adab75
improve the state of affairs with regards to oss/ent
rboyer May 1, 2023
1715872
revert hack
rboyer May 1, 2023
f30c0df
use any 2.x version of kreuzwerker/docker (#2)
nfi-hashicorp May 12, 2023
74d19c2
add support for consul DNS (#3)
rboyer May 12, 2023
4422d4a
Minor updates based on testing with HCP and 1.14.7 (#5)
freddygv Jun 1, 2023
fdb74bc
Add 'consul-topology/' from commit '4422d4a2e6f0c634cc968faa2f256df7d…
nfi-hashicorp Jun 20, 2023
83af333
rm redundant stuff
nfi-hashicorp Jun 20, 2023
62b8a7d
rename to github.com/consul/consul-topology
nfi-hashicorp Jun 20, 2023
8cb5841
fix readme
nfi-hashicorp Jun 21, 2023
4f59aa8
lint
nfi-hashicorp Jun 21, 2023
243ba4f
fix lints
nfi-hashicorp Jun 21, 2023
014aa9e
s/consul-toplogy/testingconsul
nfi-hashicorp Jun 28, 2023
f659693
Merge branch 'main' into add-consul-topology
nfi-hashicorp Jun 28, 2023
54a00a7
copy tests
nfi-hashicorp Jun 28, 2023
c407cc9
fix loopvar
nfi-hashicorp Jun 28, 2023
a954c88
add README
nfi-hashicorp Jun 28, 2023
453e7c6
use testingconsul
nfi-hashicorp Jun 28, 2023
51fdf90
add CI
nfi-hashicorp Jun 28, 2023
e20efed
avoid building unused images
nfi-hashicorp Jun 28, 2023
7205c44
remove some docker nonsense
nfi-hashicorp Jun 28, 2023
83f889f
fix merge problem in service.go
nfi-hashicorp Jun 28, 2023
19d3cb2
add replace for testingconsul in consul-container
nfi-hashicorp Jun 28, 2023
eaa316a
fix path in ci
nfi-hashicorp Jun 28, 2023
0d7f97a
ci tweaks
nfi-hashicorp Jun 28, 2023
e7706fd
more replace
nfi-hashicorp Jun 28, 2023
cb11020
more mod fiddling
nfi-hashicorp Jun 28, 2023
1537fbb
temp: 60 minute timeout?
nfi-hashicorp Jun 29, 2023
0aaf12e
fewer servers
nfi-hashicorp Jun 29, 2023
44e6848
Update go.mod
nfi-hashicorp Jun 29, 2023
93f95ab
skip ac6 for now?
nfi-hashicorp Jun 29, 2023
f86045a
fixup! fix lints
nfi-hashicorp Jun 29, 2023
e99b733
Merge remote-tracking branch 'origin/add-consul-topology' into add-pe…
nfi-hashicorp Jun 29, 2023
fc49f65
ignore .docker directory
nfi-hashicorp Jun 29, 2023
368ec4b
fix Partition in OSS
nfi-hashicorp Jun 29, 2023
20121a6
Revert "fewer servers"
nfi-hashicorp Jun 29, 2023
137c9db
Revert "temp: 60 minute timeout?"
nfi-hashicorp Jun 29, 2023
fb9b76a
fix Namespace in QueryOptions
nfi-hashicorp Jun 29, 2023
6124ac9
fix namespace in 7.2
nfi-hashicorp Jun 29, 2023
c2bbe67
SEPARATE ME: add `omitempty` to api prepared query targets
nfi-hashicorp Jun 29, 2023
4c536e5
remove unnecessary info from CI
NiniOak Jun 29, 2023
248b330
fix test names
nfi-hashicorp Jun 29, 2023
dc698db
ensure ac5 tests get run in either mode
nfi-hashicorp Jun 29, 2023
6ac0028
add ac4 to shared suite
nfi-hashicorp Jun 29, 2023
8f3ee44
stop skipping ac6
nfi-hashicorp Jun 29, 2023
ac252b0
fix some ac6 OSS assumptions
nfi-hashicorp Jul 10, 2023
f605181
refactor prepared query tests (#17966)
NiniOak Jul 11, 2023
38ee022
refactor ac5.1
NiniOak Jul 11, 2023
9d949e5
delete failing health checks and test pq failover (#18086)
NiniOak Jul 11, 2023
b3d1e2f
Update test-integ/peering_commontopo/ac5_2_test.go
nfi-hashicorp Jul 11, 2023
e4809ee
fix lints
nfi-hashicorp Jul 11, 2023
8a88ac9
update service health check
NiniOak Jul 11, 2023
9135acf
s|testingconsul|testing/deployer|g
nfi-hashicorp Jul 17, 2023
ef236a9
Merge branch 'add-consul-topology' into add-peering-commontopo-tests
nfi-hashicorp Jul 17, 2023
abf2345
s|testingconsul|testing/deployer|g
nfi-hashicorp Jul 17, 2023
0b5b675
fix linter
nfi-hashicorp Jul 17, 2023
16bd618
Merge branch 'add-consul-topology' into add-peering-commontopo-tests
nfi-hashicorp Jul 17, 2023
8979c47
Merge branch 'main' into add-consul-topology
nfi-hashicorp Jul 17, 2023
33036b5
Merge branch 'add-consul-topology' into add-peering-commontopo-tests
nfi-hashicorp Jul 17, 2023
741a247
Merge branch 'main' into add-peering-commontopo-tests
nfi-hashicorp Jul 17, 2023
7535d93
go mod tidy
nfi-hashicorp Jul 17, 2023
9dd46fd
go mod tidy
nfi-hashicorp Jul 17, 2023
7b4d45e
Update test-integ/peering_commontopo/testmain_test.go
nfi-hashicorp Jul 17, 2023
58a7834
NET-4918: Refactor topology setup and CI job (#18132)
NiniOak Jul 18, 2023
9ae08f2
unify test naming
nfi-hashicorp Jul 18, 2023
a3279bd
simplify and rename runShareableSuites
nfi-hashicorp Jul 18, 2023
5695678
call it shared topo where it is shareable, not common
nfi-hashicorp Jul 18, 2023
4f92e09
remove tiny files
nfi-hashicorp Jul 18, 2023
b02e505
helper, and list test names skipped
nfi-hashicorp Jul 18, 2023
f728bc0
rm superfluous type assert
nfi-hashicorp Jul 18, 2023
373a92c
Update test-integ/peering_commontopo/sharedtopology_test.go
nfi-hashicorp Jul 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/reusable-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
- "envoyextensions"
- "troubleshoot"
- "test/integration/consul-container"
- "testingconsul"
fail-fast: true
name: lint ${{ matrix.directory }}
steps:
Expand Down
100 changes: 99 additions & 1 deletion .github/workflows/test-integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ jobs:
-tags "${{ env.GOTAGS }}" \
-timeout=30m \
-json \
`go list ./... | grep -v upgrade` \
`go list -tags "${{ env.GOTAGS }}" ./... | grep -v upgrade | grep -v peering_commontopo` \
--target-image ${{ env.CONSUL_LATEST_IMAGE_NAME }} \
--target-version local \
--latest-image docker.mirror.hashicorp.services/${{ env.CONSUL_LATEST_IMAGE_NAME }} \
Expand Down Expand Up @@ -583,6 +583,103 @@ jobs:
DD_ENV: ci
run: datadog-ci junit upload --service "$GITHUB_REPOSITORY" $TEST_RESULTS_DIR/results.xml

peering_commontopo-integration-test:
runs-on: ${{ fromJSON(needs.setup.outputs.compute-xl) }}
needs:
- setup
- dev-build
permissions:
id-token: write # NOTE: this permission is explicitly required for Vault auth.
contents: read
strategy:
fail-fast: false
matrix:
consul-version: [ "1.14", "1.15"]
NiniOak marked this conversation as resolved.
Show resolved Hide resolved
env:
CONSUL_LATEST_VERSION: ${{ matrix.consul-version }}
ENVOY_VERSION: "1.24.6"
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
# NOTE: This step is specifically needed for ENT. It allows us to access the required private HashiCorp repos.
- name: Setup Git
if: ${{ endsWith(github.repository, '-enterprise') }}
run: git config --global url."https://${{ secrets.ELEVATED_GITHUB_TOKEN }}:@github.com".insteadOf "https://github.com"
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version-file: 'go.mod'
- run: go env

# Get go binary from workspace
- name: fetch binary
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: '${{ env.CONSUL_BINARY_UPLOAD_NAME }}'
path: .
- name: restore mode+x
run: chmod +x consul
- name: Build consul:local image
run: docker build -t ${{ env.CONSUL_LATEST_IMAGE_NAME }}:local -f ./build-support/docker/Consul-Dev.dockerfile .
- name: Peering commonTopo Integration Tests
run: |
mkdir -p "${{ env.TEST_RESULTS_DIR }}"
cd ./test/integration/consul-container/test/peering_commontopo
docker run --rm ${{ env.CONSUL_LATEST_IMAGE_NAME }}:local consul version
go run gotest.tools/gotestsum@v${{env.GOTESTSUM_VERSION}} \
--raw-command \
--format=short-verbose \
--debug \
--packages="./..." \
-- \
go test \
-p=1 \
-parallel=1 \
-tags "${{ env.GOTAGS }}" \
-timeout=30m \
-json ./... \
--target-image ${{ env.CONSUL_LATEST_IMAGE_NAME }} \
--target-version local \
--latest-image docker.mirror.hashicorp.services/${{ env.CONSUL_LATEST_IMAGE_NAME }} \
--latest-version "${{ env.CONSUL_LATEST_VERSION }}"
nfi-hashicorp marked this conversation as resolved.
Show resolved Hide resolved
ls -lrt
env:
# this is needed because of incompatibility between RYUK container and GHA
GOTESTSUM_JUNITFILE: ${{ env.TEST_RESULTS_DIR }}/results.xml
GOTESTSUM_FORMAT: standard-verbose
COMPOSE_INTERACTIVE_NO_CLI: 1
# tput complains if this isn't set to something.
TERM: ansi
# NOTE: ENT specific step as we store secrets in Vault.
- name: Authenticate to Vault
if: ${{ endsWith(github.repository, '-enterprise') }}
id: vault-auth
run: vault-auth

# NOTE: ENT specific step as we store secrets in Vault.
- name: Fetch Secrets
if: ${{ endsWith(github.repository, '-enterprise') }}
id: secrets
uses: hashicorp/[email protected]
with:
url: ${{ steps.vault-auth.outputs.addr }}
caCertificate: ${{ steps.vault-auth.outputs.ca_certificate }}
token: ${{ steps.vault-auth.outputs.token }}
secrets: |
kv/data/github/${{ github.repository }}/datadog apikey | DATADOG_API_KEY;

- name: prepare datadog-ci
if: ${{ !endsWith(github.repository, '-enterprise') }}
run: |
curl -L --fail "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_linux-x64" --output "/usr/local/bin/datadog-ci"
chmod +x /usr/local/bin/datadog-ci

- name: upload coverage
# do not run on forks
if: github.event.pull_request.head.repo.full_name == github.repository
env:
DATADOG_API_KEY: "${{ endsWith(github.repository, '-enterprise') && env.DATADOG_API_KEY || secrets.DATADOG_API_KEY }}"
DD_ENV: ci
run: datadog-ci junit upload --service "$GITHUB_REPOSITORY" $TEST_RESULTS_DIR/results.xml

nfi-hashicorp marked this conversation as resolved.
Show resolved Hide resolved
test-integrations-success:
needs:
- setup
Expand All @@ -592,6 +689,7 @@ jobs:
- generate-envoy-job-matrices
- envoy-integration-test
- compatibility-integration-test
- peering_commontopo-integration-test
- upgrade-integration-test
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }}
if: ${{ always() }}
Expand Down
3 changes: 3 additions & 0 deletions test-integ/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# test-integ

Go integration tests for consul. `/test/integration` also holds integration tests; they need migrating.
103 changes: 103 additions & 0 deletions test-integ/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
module github.com/hashicorp/consul/test-integ

go 1.20

require (
github.com/hashicorp/consul/api v1.22.0
github.com/hashicorp/consul/sdk v0.14.0
github.com/hashicorp/consul/test/integration/consul-container v0.0.0-20230628201853-bdf4fad7c5a5
github.com/hashicorp/consul/testingconsul v0.0.0-00010101000000-000000000000
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/itchyny/gojq v0.12.13
github.com/mitchellh/copystructure v1.2.0
github.com/stretchr/testify v1.8.4
)

require (
fortio.org/dflag v1.5.2 // indirect
fortio.org/fortio v1.54.0 // indirect
fortio.org/log v1.3.0 // indirect
fortio.org/sets v1.0.2 // indirect
fortio.org/version v1.0.2 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/agext/levenshtein v1.2.1 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/avast/retry-go v3.0.0+incompatible // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/containerd/containerd v1.7.1 // indirect
github.com/cpuguy83/dockercfg v0.3.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/docker v23.0.6+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/fatih/color v1.14.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-msgpack v0.5.5 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.2.1 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/hcl/v2 v2.16.2 // indirect
github.com/hashicorp/memberlist v0.5.0 // indirect
github.com/hashicorp/serf v0.10.1 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/itchyny/timefmt-go v0.1.5 // indirect
github.com/klauspost/compress v1.16.5 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/miekg/dns v1.1.50 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/patternmatcher v0.5.0 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc3 // indirect
github.com/opencontainers/runc v1.1.7 // indirect
github.com/otiai10/copy v1.10.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rboyer/safeio v0.2.2 // indirect
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/teris-io/shortid v0.0.0-20220617161101-71ec9f2aa569 // indirect
github.com/testcontainers/testcontainers-go v0.20.1 // indirect
github.com/zclconf/go-cty v1.12.1 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/tools v0.9.1 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.55.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.4.0 // indirect
)

replace (
github.com/hashicorp/consul => ../
github.com/hashicorp/consul/api => ../api
github.com/hashicorp/consul/envoyextensions => ../envoyextensions
github.com/hashicorp/consul/proto-public => ../proto-public
github.com/hashicorp/consul/sdk => ../sdk
github.com/hashicorp/consul/testingconsul => ../testingconsul
)
Loading