Skip to content

Commit

Permalink
Merge pull request #1237 from openziti/remove-test-dir
Browse files Browse the repository at this point in the history
Remove old utilities in test dir
  • Loading branch information
plorenz authored Aug 8, 2023
2 parents a45d101 + dd521e1 commit 1b2fd0e
Show file tree
Hide file tree
Showing 22 changed files with 297 additions and 932 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: golangci-lint
on:
pull_request:
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '1.20.x'

- uses: actions/checkout@v3

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.53.3

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
args: --build-tags apitests

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# Optional: if set to true then the all caching functionality will be complete disabled,
# takes precedence over all other caching options.
# skip-cache: true

# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true

# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
run:
deadline: 8m
skip-files:
- ziti/cmd/edge/verify_ca.go
46 changes: 46 additions & 0 deletions TESTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Smoketest

The ziti project uses a fablab based environment to run smoketests. These tests are run
in github, but can be run locally as well.

## Running smoketests locally

First you must have an AWS account with permissions to create VPCs, setup security groups
and run EC2 instances. If you are able to the run the AWS CLI using an access key and
secret token, the smoketest should work as well.

The following steps assume you are starting at the root of a cloned `ziti` repository.

```
$ cd zititest
$ go install ./...
$ simple-transfer create
$ ZITI_VERSION=0.0.0 simple-transfer up
$ go test -v ./tests/...
$ simple-transfer dispose
```

## Debugging smoketests

When a smoketest runs in Github, the fablab instance data is uploaded to s3. This includes
everything need to work with the instance. If the smoketest run fails, the teardown will
be delayed by half of an hour. In that half of an hour the instance data can be downloaded
and the instance can be investigated. If you wish to prevent the instance from being
torn down by the workflow, you can delete the instance data out of S3 and take responsiblility
for cleaning it up yourself.

The instance data is encrypted and requires a passphrase to decrypt. Here's an example
script which can import a GH actions workflow instance into your local environment.

```
aws s3 cp s3://ziti-smoketest-fablab-instances/simple-transfer-$1.tar.gz.gpg ${HOME}/Downloads/simple-transfer-$1.tar.gz.gpg
FABLAB_PASSPHRASE=<passphrase goes here> simple-transfer import ${HOME}/Downloads/simple-transfer-$1.tar.gz.gpg
rm ${HOME}/Downloads/simple-transfer-$1.tar.gz.gpg
```
You would pass the workflow run number into the script. If you need the GPG passphrase, please ask.

To delete the instance data out of S3, you would run:

```
aws s3 rm s3://ziti-smoketest-fablab-instances/simple-transfer-$1.tar.gz.gpg
```
4 changes: 2 additions & 2 deletions doc/ha/dev-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ You should now have a three node cluster running. You can log into each controll
You could then create some model data on any controller:

```
ziti learn demo setup echo client
ziti learn demo setup echo single-sdk-hosted
ziti demo setup echo client
ziti demo setup echo single-sdk-hosted
```

Any view the results on any controller
Expand Down
11 changes: 7 additions & 4 deletions doc/ha/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,16 @@ There are now three new agent commands specific to the controller.

```shell
# Adding Members
ziti agent controller raft-join <other controller raft address>
ziti agent cluster add <other controller raft address>
# Listing Members
ziti agent controller raft-list
ziti agent cluster list
# Removing Members
ziti agent controller raft-remove <controller id>
ziti agent cluster remove <controller id>
# Transfer Leadership
ziti agent cluster transfer-leadership [new leader id]
```

#### Edge Admin Initialization
Expand Down Expand Up @@ -281,4 +284,4 @@ get more robust and distributed over time.
### Api Sessions, Sessions, Posture Data
API Sessions and Sessions are moving to bearer tokens. Posture Data is TBD.
API Sessions and Sessions are moving to bearer tokens. Posture Data is TBD.
49 changes: 27 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,31 @@ require (
github.com/gorilla/websocket v1.5.0
github.com/jedib0t/go-pretty/v6 v6.4.0
github.com/michaelquigley/pfxlog v0.6.10
github.com/openziti/agent v1.0.14
github.com/openziti/channel/v2 v2.0.87
github.com/openziti/edge v0.24.372
github.com/openziti/edge-api v0.25.30
github.com/openziti/agent v1.0.15
github.com/openziti/channel/v2 v2.0.89
github.com/openziti/edge v0.24.374
github.com/openziti/edge-api v0.25.31
github.com/openziti/fabric v0.23.52
github.com/openziti/foundation/v2 v2.0.28
github.com/openziti/identity v1.0.59
github.com/openziti/runzmd v1.0.28
github.com/openziti/sdk-golang v0.20.80
github.com/openziti/sdk-golang v0.20.87
github.com/openziti/storage v0.2.11
github.com/openziti/transport/v2 v2.0.96
github.com/openziti/transport/v2 v2.0.97
github.com/openziti/xweb/v2 v2.1.0
github.com/openziti/ziti-db-explorer v1.1.1
github.com/pkg/errors v0.9.1
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
github.com/russross/blackfriday v1.5.2
github.com/shirou/gopsutil/v3 v3.23.6
github.com/shirou/gopsutil/v3 v3.23.7
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.10.0
github.com/stretchr/testify v1.8.4
go.etcd.io/bbolt v1.3.7
golang.org/x/net v0.12.0
google.golang.org/grpc v1.56.2
golang.org/x/net v0.14.0
golang.org/x/text v0.12.0
google.golang.org/protobuf v1.31.0
gopkg.in/AlecAivazis/survey.v1 v1.8.7
gopkg.in/resty.v1 v1.12.0
Expand Down Expand Up @@ -81,18 +81,20 @@ require (
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-openapi/analysis v0.21.4 // indirect
github.com/go-openapi/errors v0.20.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/loads v0.21.2 // indirect
github.com/go-openapi/spec v0.20.9 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-openapi/validate v0.22.1 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang-jwt/jwt/v5 v5.0.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/gomarkdown/markdown v0.0.0-20230322041520-c84983bdbf2a // indirect
github.com/gomarkdown/markdown v0.0.0-20230716120725-531d2d74bc12 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/schema v1.2.0 // indirect
github.com/gorilla/securecookie v1.1.1 // 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
Expand All @@ -118,7 +120,7 @@ require (
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mattn/go-tty v0.0.3 // indirect
github.com/mdlayher/netlink v1.7.2 // indirect
github.com/mdlayher/socket v0.4.1 // indirect
Expand All @@ -127,6 +129,7 @@ require (
github.com/miekg/pkcs11 v1.1.1 // indirect
github.com/mitchellh/go-ps v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/muhlemmer/gu v0.3.1 // indirect
github.com/natefinch/lumberjack v2.0.0+incompatible // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
Expand All @@ -144,6 +147,7 @@ require (
github.com/rabbitmq/amqp091-go v1.8.1 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rodaine/table v1.0.1 // indirect
github.com/rs/cors v1.9.0 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect
github.com/speps/go-hashids v2.0.0+incompatible // indirect
Expand All @@ -160,22 +164,23 @@ require (
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.mongodb.org/mongo-driver v1.12.0 // indirect
github.com/zitadel/oidc/v2 v2.6.4 // indirect
go.mongodb.org/mongo-driver v1.12.1 // indirect
go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 // indirect
go.opentelemetry.io/otel v1.16.0 // indirect
go.opentelemetry.io/otel/metric v1.16.0 // indirect
go.opentelemetry.io/otel/trace v1.16.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/image v0.9.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/exp v0.0.0-20230807204917-050eac23e9de // indirect
golang.org/x/image v0.11.0 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/oauth2 v0.9.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
nhooyr.io/websocket v1.8.7 // indirect
)
Loading

0 comments on commit 1b2fd0e

Please sign in to comment.