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

test: Integration Tests Enhancement and Coinbase Commerce Integration #1767

Merged
merged 18 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from 12 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
13 changes: 5 additions & 8 deletions .github/workflows/integrationTests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@ jobs:
- name: Build packages
run: pnpm build

- name: Check for API key
run: |
if [ -z "$OPENAI_API_KEY" ]; then
echo "Error: OPENAI_API_KEY is not set."
exit 1
fi

- name: Run integration tests
run: pnpm run integrationTests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
COINBASE_COMMERCE_KEY: ${{ secrets.COINBASE_COMMERCE_KEY }}
run: |
pnpm run integrationTests
18 changes: 11 additions & 7 deletions packages/plugin-coinbase/src/plugins/commerce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export async function getAllCharges(apiKey: string) {
// Function to fetch details of a specific charge
export async function getChargeDetails(apiKey: string, chargeId: string) {
elizaLogger.debug("Starting getChargeDetails function");
const getUrl = `${url}${chargeId}`;
const getUrl = `${url}/${chargeId}`;

try {
const response = await fetch(getUrl, {
Expand Down Expand Up @@ -204,8 +204,8 @@ export const createCoinbaseChargeAction: Action = {
text: `Charge created successfully: ${chargeResponse.hosted_url}`,
attachments: [
{
id: crypto.randomUUID(),
url: chargeResponse.id,
id: chargeResponse.id,
url: chargeResponse.hosted_url,
title: "Coinbase Commerce Charge",
description: `Charge ID: ${chargeResponse.id}`,
text: `Pay here: ${chargeResponse.hosted_url}`,
Expand Down Expand Up @@ -351,6 +351,7 @@ export const getAllChargesAction: Action = {
callback(
{
text: `Successfully fetched all charges. Total charges: ${charges.length}`,
attachments: charges,
},
[]
);
Expand Down Expand Up @@ -439,17 +440,20 @@ export const getChargeDetailsAction: Action = {

elizaLogger.info("Fetched charge details:", chargeDetails);

const chargeData = chargeDetails.data;

callback(
{
text: `Successfully fetched charge details for ID: ${charge.id}`,
attachments: [
{
id: crypto.randomUUID(),
url: chargeDetails.hosted_url,
id: chargeData.id,
url: chargeData.hosted_url,
title: `Charge Details for ${charge.id}`,
description: `Details: ${JSON.stringify(chargeDetails, null, 2)}`,
source: "coinbase",
text: "",
description: JSON.stringify(chargeDetails, null, 2),
text: `Pay here: ${chargeData.hosted_url}`,
contentType: "application/json",
},
],
},
Expand Down
Loading
Loading