-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: ci unit test * test: skip error test * test: fix test error * test: test current code with OFFLINE_BUILD * test: fix test error * test: fix test error and change timeout * test: fix test ci error * test: fix test ci error * test: fix test ci error * test: fix test ci error * test: fix test ci error * test: fix test ci error * test: setting timeout * test: fix test error * test: fix test error * test: fix test error * test: typo regexp * test: fix test error * fix: test error * chore: restore-generated-file * chore: modify .gitignore * chore: Comment out useless methods * chore: remove config/generated.go * chore: add .gitkeep * chore: restore generated file
- Loading branch information
Showing
60 changed files
with
2,307 additions
and
1,880 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Unit Test | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
build: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
env: | ||
GO_VERSION: 1.23.4 | ||
steps: | ||
- name: Checkout current repository | ||
uses: actions/checkout@v4 | ||
with: | ||
path: framework | ||
|
||
- name: Checkout framework-vendor | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: main | ||
repository: infinilabs/framework-vendor | ||
path: vendor | ||
|
||
- name: Set up go toolchain | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
check-latest: false | ||
cache: true | ||
|
||
- name: Check go toolchain | ||
run: go version | ||
|
||
- name: Unit test | ||
env: | ||
GOFLAGS: -tags=ci | ||
run: | | ||
echo Home path is $HOME | ||
export WORKBASE=$HOME/go/src/infini.sh | ||
export WORK=$WORKBASE/framework | ||
# for test workspace | ||
mkdir -p $HOME/go/src/ | ||
ln -s $GITHUB_WORKSPACE $WORKBASE | ||
# check work folder | ||
ls -lrt $WORKBASE/ | ||
ls -alrt $WORK | ||
# for unit test | ||
cd $WORK | ||
echo Testing code at $PWD ... | ||
OFFLINE_BUILD=true CI=true make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package config | ||
|
||
const LastCommitLog = "N/A" | ||
|
||
const BuildDate = "N/A" | ||
|
||
const EOLDate = "N/A" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package util | ||
|
||
import ( | ||
"os" | ||
|
||
log "github.com/cihub/seelog" | ||
) | ||
|
||
const ( | ||
defaultLogConfig = ` | ||
<seelog type="sync" minlevel="info"> | ||
<outputs formatid="main"> | ||
<console /> | ||
</outputs> | ||
<formats> | ||
<format id="main" format="%Date/%Time [%LEV] %Msg%n"/> | ||
</formats> | ||
</seelog> | ||
` | ||
|
||
testLogConfig = ` | ||
<seelog type="sync" minlevel="info"> | ||
<outputs formatid="main"> | ||
<console /> | ||
</outputs> | ||
<formats> | ||
<format id="main" format="%Date/%Time [%LEV] %Msg%n"/> | ||
</formats> | ||
</seelog> | ||
` | ||
) | ||
|
||
func init() { | ||
logConfig := defaultLogConfig | ||
if os.Getenv("CI") == "true" { | ||
logConfig = testLogConfig | ||
} | ||
|
||
logger, err := log.LoggerFromConfigAsString(logConfig) | ||
if err != nil { | ||
panic(err) | ||
} | ||
log.ReplaceLogger(logger) | ||
} |
Oops, something went wrong.