Skip to content

Commit

Permalink
Merge pull request #1641 from DefiLlama/fix-ci-llamastest
Browse files Browse the repository at this point in the history
fix ci
  • Loading branch information
dtmkeng committed Jul 3, 2024
2 parents ffa245b + 882caba commit b13edb5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/commentResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,24 @@ async function main() {
const [_, adapterName] = adapterNameKey.split('@')


const errorString = '------ ERROR ------';
const summaryIndex = file.indexOf('_______________________________________');
const errorString = 'ERROR';
const summaryIndex = file.indexOf('---------------------------------------------------');
const errorIndex = file.indexOf(errorString);
let body;

if (summaryIndex != -1) {
body = `The ${adapterName} adapter exports:
\n \n ${file.substring(summaryIndex).replaceAll('\n', '\n ')}`;
body = `The ${adapterName} adapter exports:
\n \n ${file.replaceAll('\n', '\n ')}`;
console.info(`Posting comment:\n${body}`)
} else if (errorIndex != -1) {
body = `Error while running adapter ${adapterName} adapter:
body = `Error while running adapter ${adapterName} adapter:
\n \n ${file.split(errorString)[1].replaceAll('\n', '\n ')}`;
} else
console.info(`Posting comment:\n${body}`)
} else {
console.info(`No error or summary found in log file`);
return;
}


console.info(`Posting comment:\n${body}`)

Expand All @@ -37,4 +42,4 @@ async function main() {
function translate(input) {
return input ? translate(input.substring(1)) + input[0] : input;
};
main();
main();
12 changes: 6 additions & 6 deletions .github/workflows/test-adapter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
run: |
# Store the current commit hash in a variable
current_commit=$(git rev-parse HEAD)
# Checkout to master to check if new adapters files are of v2
git fetch origin master:master
# Checkout back to the original commit
git checkout $current_commit
RUN_FILES=$(
MODIFIED=${{ steps.file_changes.outputs.files_modified}} \
ADDED=${{ steps.file_changes.outputs.files_added}} \
Expand All @@ -38,15 +38,15 @@ jobs:
list=$(echo $RUN_FILES | tr -d '"[]' | tr "," "\n")
for i in ${list}
do
{
do
{
IFS='@' read -r -a array <<< "$i"
npm run test ${array[0]} ${array[1]} 2>&1 | tee output.txt
node ${{ github.workspace }}/.github/workflows/commentResult.js /home/runner/work/dimension-adapters/dimension-adapters/output.txt "${{ github.repository_owner }}" "${{ github.event.repository.name }}" "${{ github.event.number }}" ${i}
if grep -q "\-\-\-\- ERROR \-\-\-\-" output.txt; then
exit 1;
fi
} || {
} || {
echo -n $i
echo ' doesnt run'
}
Expand Down
2 changes: 2 additions & 0 deletions aggregators/avnu/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const fetch = async (timestamp: number): Promise<FetchResult> => {
totalVolume,
timestamp: dayTimestamp,
};


}

const adapter: SimpleAdapter = {
Expand Down
5 changes: 4 additions & 1 deletion aggregators/flowx-aggregator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ const fetchVolume = async (options: FetchOptions) => {
const record = res[0];
return {
dailyVolume: record.totalUSD,
};
}



};

const adapter: any = {
Expand Down

0 comments on commit b13edb5

Please sign in to comment.