Skip to content

Commit

Permalink
Merge pull request #109 from YukiOnishi1129/feature/test
Browse files Browse the repository at this point in the history
Feature/test
  • Loading branch information
YukiOnishi1129 authored Jun 21, 2024
2 parents 09c74ca + 187505a commit ad3bf6b
Show file tree
Hide file tree
Showing 16 changed files with 79 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package usecase

import "testing"

func Test_Usecase_BatchCrawlCompanyArticleContents(t *testing.T) {
// 1. feed , same platform 2, deletedAr 1, trend
// rss 1件、 2件 10件
// 2. rss 0件
// 2. feed 0 件
t.Parallel()
}
14 changes: 14 additions & 0 deletions batch-service/cmd/article-company-crawler/usecase/package_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package usecase

import (
"os"
"testing"

"github.com/YukiOnishi1129/techpicks/batch-service/testutil"
)

func TestMain(m *testing.M) {
testutil.BeforeAllTest()
// This is a test runner
os.Exit(m.Run())
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package usecase

import "testing"

func Test_Usecase_BatchCrawlCompanyArticleContents(t *testing.T) {
// 1. feed , same platform 2, deletedAr 1, trend
// rss 1件、 2件 10件
// 2. rss 0件
// 2. feed 0 件
t.Parallel()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package usecase

import (
"os"
"testing"

"github.com/YukiOnishi1129/techpicks/batch-service/testutil"
)

func TestMain(m *testing.M) {
testutil.BeforeAllTest()
// This is a test runner
os.Exit(m.Run())
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package usecase

import "testing"

func Test_Usecase_BatchCrawlTrendArticleContents(t *testing.T) {
// 1. feed , same platform 2, deletedAr 1, trend
// rss 1件、 2件 10件
// 2. rss 0件
// 2. feed 0 件
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func (u *Usecase) devCommunityArticleCrawler(ctx context.Context, feed *entity.F
ArticleAuthorName: &d.User.UserName,
ArticleTags: &d.Tags,
ArticleOGPImageURL: d.CoverImage,
IsEng: feed.R.Platform.IsEng,
})
if err != nil && res.IsRollback {
log.Printf("【error rollback transaction】: %s", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func (u *Usecase) hashnodeArticleCrawler(ctx context.Context, feed *entity.Feed)
ArticleAuthorName: &d.Node.Author.Name,
ArticleTags: &articleTags,
ArticleOGPImageURL: d.Node.CoverImage.URL,
IsEng: feed.R.Platform.IsEng,
})
if err != nil && res.IsRollback {
log.Printf("【error rollback transaction】: %s", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func (u *Usecase) hatenaArticleCrawler(ctx context.Context, feed *entity.Feed) e
ArticleAuthorName: &r.AuthorName,
ArticleTags: &r.Tags,
ArticleOGPImageURL: r.ImageURL,
IsEng: feed.R.Platform.IsEng,
})
if err != nil && res.IsRollback {
log.Printf("【error rollback transaction】: %s", err)
Expand Down
14 changes: 14 additions & 0 deletions batch-service/cmd/trend-article-crawler/usecase/package_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package usecase

import (
"os"
"testing"

"github.com/YukiOnishi1129/techpicks/batch-service/testutil"
)

func TestMain(m *testing.M) {
testutil.BeforeAllTest()
// This is a test runner
os.Exit(m.Run())
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func (u *Usecase) qiitaArticleCrawler(ctx context.Context, feed *entity.Feed) er
ArticleAuthorName: &r.AuthorName,
ArticleTags: &r.Tags,
ArticleOGPImageURL: r.ImageURL,
IsEng: feed.R.Platform.IsEng,
})
if err != nil && res.IsRollback {
log.Printf("【error rollback transaction】: %s", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func (u *Usecase) zennArticleCrawler(ctx context.Context, feed *entity.Feed) err
ArticleAuthorName: nil,
ArticleTags: nil,
ArticleOGPImageURL: ogpImageURL,
IsEng: feed.R.Platform.IsEng,
})
if err != nil && res.IsRollback {
log.Printf("【error rollback transaction】: %s", err)
Expand Down

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions batch-service/internal/convert.go

This file was deleted.

0 comments on commit ad3bf6b

Please sign in to comment.