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

feat: improve testing #103

Merged
merged 2 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test
name: Test Kubo (e2e)

on:
workflow_dispatch:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/test-tooling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test Tooling

on:
workflow_dispatch:
push:
branches:
- main
pull_request:

jobs:
test:
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
defaults:
run:
shell: bash
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.20.4
- uses: actions/checkout@v3
with:
path: 'gateway-conformance'
- uses: protocol/cache-go-action@v1
- name: Run the tests
shell: bash
working-directory: ./gateway-conformance
run: |
go test ./tooling/...
6 changes: 3 additions & 3 deletions tooling/tmpl/tmpl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func TestTemplatingWithEscaping(t *testing.T) {
assert.Equal(t,
"foo/{first}/{{}}/{{another}}/bar/{{{escaped}}}/{{first}}/baz",
Fmt(
"{{first}}/{first}/{{{}}}/{{{another}}}/{{}}/{{{{escaped}}}}/{{{first}}}/{{two}}",
"{{first}}/{first}/{{{}}}/{{{another}}}/{{two}}/{{{{escaped}}}}/{{{first}}}/{{three}}",
"foo",
"bar",
"baz",
Expand All @@ -169,15 +169,15 @@ func TestTemplatingWithEscaping(t *testing.T) {
assert.Equal(t,
"{{foo",
Fmt(
"{{{{}}",
"{{{{tmpl}}",
"foo",
),
)

assert.Equal(t,
"{name}}/{{foo/{barname}}}/{{{name}}}",
Fmt(
"{name}}/{{{{name}}/{{{}}name}}}/{{{{name}}}}",
"{name}}/{{{{name}}/{{{two}}name}}}/{{{{name}}}}",
"foo",
"bar",
),
Expand Down
Loading