Skip to content
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
5 changes: 5 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ coverage:
patch:
default:
target: 80%

ignore:
- "testdata"
- "internal/antest"
- "internal/testintegration"
14 changes: 7 additions & 7 deletions analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func TestAnalyzer_All(t *testing.T) {
func TestAnalyzer_DefinitionAnalysis(t *testing.T) {
t.Parallel()

doc := antest.LoadOrFail(t, filepath.Join("fixtures", "definitions.yml"))
doc := antest.LoadOrFail(t, filepath.Join("testdata", "definitions.yml"))

analyzer := New(doc)
definitions := analyzer.allSchemas
Expand Down Expand Up @@ -208,7 +208,7 @@ func TestAnalyzer_DefinitionAnalysis(t *testing.T) {
func TestAnalyzer_ReferenceAnalysis(t *testing.T) {
t.Parallel()

doc := antest.LoadOrFail(t, filepath.Join("fixtures", "references.yml"))
doc := antest.LoadOrFail(t, filepath.Join("testdata", "references.yml"))
an := New(doc)

definitions := an.references
Expand Down Expand Up @@ -292,7 +292,7 @@ func TestAnalyzer_ReferenceAnalysis(t *testing.T) {
func TestAnalyzer_AllRefsByLocation(t *testing.T) {
t.Parallel()

doc := antest.LoadOrFail(t, filepath.Join("fixtures", "references.yml"))
doc := antest.LoadOrFail(t, filepath.Join("testdata", "references.yml"))
an := New(doc)

byLocation := an.AllRefsByLocation()
Expand Down Expand Up @@ -373,7 +373,7 @@ type expectedPattern struct {
func TestAnalyzer_PatternAnalysis(t *testing.T) {
t.Parallel()

doc := antest.LoadOrFail(t, filepath.Join("fixtures", "patterns.yml"))
doc := antest.LoadOrFail(t, filepath.Join("testdata", "patterns.yml"))
an := New(doc)
pt := an.patterns

Expand Down Expand Up @@ -760,7 +760,7 @@ func TestAnalyzer_SecurityRequirementsDefinitions(t *testing.T) {
func TestAnalyzer_MoreParamAnalysis(t *testing.T) {
t.Parallel()

bp := filepath.Join("fixtures", "parameters", "fixture-parameters.yaml")
bp := filepath.Join("testdata", "parameters", "fixture-parameters.yaml")
sp := antest.LoadOrFail(t, bp)

an := New(sp)
Expand Down Expand Up @@ -873,7 +873,7 @@ func TestAnalyzer_EdgeCases(t *testing.T) {
func TestAnalyzer_EnumAnalysis(t *testing.T) {
t.Parallel()

doc := antest.LoadOrFail(t, filepath.Join("fixtures", "enums.yml"))
doc := antest.LoadOrFail(t, filepath.Join("testdata", "enums.yml"))

an := New(doc)
en := an.enums
Expand Down Expand Up @@ -1087,7 +1087,7 @@ func prepareTestParamsValid() *Spec {
}

func prepareTestParamsInvalid(t testing.TB, fixture string) *Spec {
bp := filepath.Join("fixtures", fixture)
bp := filepath.Join("testdata", fixture)
spec := antest.LoadOrFail(t, bp)

analyzer := New(spec)
Expand Down
8 changes: 4 additions & 4 deletions diff/spec_analyser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestDiffForVariousCombinations(t *testing.T) {
require.NotEmpty(t, allTests)

// To filter cases for debugging poke an individual case here eg "path", "enum" etc
// see the test cases in fixtures/diff
// see the test cases in testdata/diff
// Don't forget to remove it once you're done.
// (There's a test at the end to check all cases were run)
matches := allTests
Expand Down Expand Up @@ -110,8 +110,8 @@ func makeTestCases(t testing.TB, matches []string) []testCaseData {
}

func TestIssue2962(t *testing.T) {
oldSpec := filepath.Join("fixtures", "bugs", "2962", "old.json")
newSpec := filepath.Join("fixtures", "bugs", "2962", "new.json")
oldSpec := filepath.Join("testdata", "bugs", "2962", "old.json")
newSpec := filepath.Join("testdata", "bugs", "2962", "new.json")

t.Run("should diff", func(t *testing.T) {
diffs, err := getDiffs(oldSpec, newSpec)
Expand All @@ -130,7 +130,7 @@ func TestIssue2962(t *testing.T) {
}

func fixturePath(file string, parts ...string) string {
return filepath.Join("fixtures", strings.Join(append([]string{file}, parts...), ""))
return filepath.Join("testdata", strings.Join(append([]string{file}, parts...), ""))
}

type testCaseData struct {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion fixer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
func TestFixer_EmptyResponseDescriptions(t *testing.T) {
t.Parallel()

bp := filepath.Join("fixtures", "fixer", "fixer.yaml")
bp := filepath.Join("testdata", "fixer", "fixer.yaml")
sp := antest.LoadOrFail(t, bp)

FixEmptyResponseDescriptions(sp)
Expand Down
4 changes: 2 additions & 2 deletions flatten_name_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func TestName_SplitKey(t *testing.T) {
}

func TestName_NamesFromKey(t *testing.T) {
bp := filepath.Join("fixtures", "inline_schemas.yml")
bp := filepath.Join("testdata", "inline_schemas.yml")
sp := antest.LoadOrFail(t, bp)

values := []struct {
Expand Down Expand Up @@ -461,7 +461,7 @@ func TestName_InlinedSchemas(t *testing.T) {
},
}

bp := filepath.Join("fixtures", "nested_inline_schemas.yml")
bp := filepath.Join("testdata", "nested_inline_schemas.yml")
sp := antest.LoadOrFail(t, bp)

require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{
Expand Down
Loading
Loading