Skip to content

Commit

Permalink
Redis Stream Source Unit + E2E Tests (#5)
Browse files Browse the repository at this point in the history
* Adding placeholders for graceful termination code

* E2E test additions

* Adding branch to github action

* Adding branch to github action

* Removing @master for ko

* Trying older release for ko

* Removing ko

* Removing Whitelist IP

* Updating dependencies

* Updating dependencies

* Updating dependencies

* Adding unit tests for redis source

* Adding unit tests for redis source

* Adding unit tests for redis source

* Adding unit tests for redis source

* Removing user

* Removing ko
  • Loading branch information
aavarghese authored Oct 19, 2020
1 parent 476fe71 commit 5d945aa
Show file tree
Hide file tree
Showing 2,129 changed files with 373,789 additions and 94,485 deletions.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Bug
about: Create a bug report to help us improve
title: ''
labels: kind/bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**Expected behavior**
A clear and concise description of what you expected to happen.

**To Reproduce**
Steps to reproduce the behavior.

**Knative release version**

**Additional context**
Add any other context about the problem here such as proposed priority
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature Request
about: "Suggest an idea for this project\tabout"
title: ''
labels: kind/feature-request
assignees: ''

---

**Problem**
A short explanation of the problem, including relevant restrictions.

**[Persona:](https://github.com/knative/eventing/blob/master/docs/personas.md)**
Which persona is this feature for?

**Exit Criteria**
A measurable (binary) test that would indicate that the problem has been resolved.

**Time Estimate (optional):**
How many developer-days do you think this may take to resolve?

**Additional context (optional)**
Add any other context about the feature request here.
11 changes: 11 additions & 0 deletions .github/issue-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Expected Behavior

## Actual Behavior

## Steps to Reproduce the Problem

1.
2.
3.

## Additional Info
43 changes: 43 additions & 0 deletions .github/pull-request-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Fixes #

<!-- Please include the 'why' behind your changes if no issue exists -->

## Proposed Changes

-
-
-

<!--
If this change has user-visible impact, follow the instructions below.
Examples include:
- 🎁 Add new feature
- 🐛 Fix bug
- 🧽 Update or clean up current behavior
- 🗑️ Remove feature or internal logic
Otherwise delete the rest of this template.
-->

**Release Note**

<!--
🗒️ If this change has user-visible impact, write a release note in the block
below. Include the string "action required" if additional action is required of
users switching to the new release, for example in case of a breaking change.
Write as if you are speaking to users, not other Knative contributors. If this
change has no user-visible impact, no release-note is needed.
-->

```release-note
```

**Docs**

<!--
📖 If this change has user-visible impact, link to an issue or PR in
https://github.com/knative/docs.
-->
39 changes: 39 additions & 0 deletions .github/workflows/kind-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Kind e2e tests"
on:
push:
branches: [ 'master', 'release-*', 'sourceTests*' ]
pull_request:
branches: [ 'master', 'release-*', 'sourceTests*' ]
jobs:
e2e-testing:
name: RedisSource Test
runs-on: ubuntu-latest
env:
KO_DOCKER_REPO: kind.local
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Set up Go 1.15.x
uses: actions/setup-go@v2
with:
go-version: 1.15.x
# - name: Install ko
# run: |
# GO111MODULE=on go get github.com/google/ko/cmd/ko
- name: Install kubectl
uses: azure/setup-kubectl@v1
with:
version: 'v1.19.0'
- name: Setup kind
uses: engineerd/[email protected]
with:
version: "v0.9.0"
config: test/kind-config.yaml
- name: Setup cluster
run: |
go test -v ./test/... -timeout=15m -tags=e2e -setup=true
- name: Run Tests
run: |
go test -v -race -timeout=15m -tags=e2e ./test/...
49 changes: 49 additions & 0 deletions .github/workflows/knative-go-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright 2020 The Knative Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Build

on:
push:
branches: [ 'master', 'release-*' ]
pull_request:
branches: [ 'master', 'release-*' ]

jobs:

build:
name: Build
strategy:
matrix:
go-version: [1.15.x]
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}

steps:

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Check out code
uses: actions/checkout@v2

- name: Vet
run: go vet ./...

- name: Build
run: go build -v ./...
46 changes: 46 additions & 0 deletions .github/workflows/knative-go-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2020 The Knative Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Test

on:
push:
branches: [ 'master', 'release-*' ]
pull_request:
branches: [ 'master', 'release-*' ]

jobs:

test:
name: Test
strategy:
matrix:
go-version: [1.15.x]
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}

steps:

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
id: go

- name: Check out code
uses: actions/checkout@v2

- name: Test
run: go test -race ./...
31 changes: 31 additions & 0 deletions .github/workflows/knative-stale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'Close stale'
on:
schedule:
- cron: '* * * * *'

jobs:
stale:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/stale@v3'
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}' # No need to setup

stale-issue-message: |-
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with `/reopen`. Mark the issue as
fresh by adding the comment `/remove-lifecycle stale`.
stale-issue-label: 'lifecycle/stale'
exempt-issue-labels: 'lifecycle/frozen'

stale-pr-message: |-
This Pull Request is stale because it has been open for 90 days with
no activity. It will automatically close after 30 more days of
inactivity. Reopen with `/reopen`. Mark as fresh by adding the
comment `/remove-lifecycle stale`.
stale-pr-label: 'lifecycle/stale'
exempt-pr-labels: 'lifecycle/frozen'

days-before-stale: 90
days-before-close: 30
57 changes: 57 additions & 0 deletions .github/workflows/knative-style.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Copyright 2020 The Knative Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Code Style

on:
push:
branches: [ 'master', 'release-*' ]
pull_request:
branches: [ 'master', 'release-*' ]

jobs:

lint:
name: Lint
runs-on: ubuntu-latest

steps:

- name: Set up Go 1.15.x
uses: actions/setup-go@v2
with:
go-version: 1.15.x
id: go

- name: Check out code
uses: actions/checkout@v2

# TODO: add prettier step
# TODO: add goimports step

- name: Go Format
shell: bash
run: |
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)
- name: Verify
shell: bash
run: |
if [[ $(git diff-index --name-only HEAD --) ]]; then
echo "Found diffs in:"
git diff-index --name-only HEAD --
echo "${{ github.repository }} is out of style. Please run go fmt."
exit 1
fi
echo "${{ github.repository }} is formatted correctly."
Loading

0 comments on commit 5d945aa

Please sign in to comment.