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
41 changes: 11 additions & 30 deletions .github/workflows/newman-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
branches: [dev, main]
paths:
- "src/**"
- "postman/**"
pull_request:
branches: [dev, main]
paths:
- "src/**"
- "postman/**"

jobs:
test:
Expand All @@ -32,31 +34,16 @@ jobs:
restore-keys: |
maven-${{ runner.os }}-

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Build & Run Tests with Maven
run: mvn clean package -DskipTests

- name: Ensure JAR file exists
run: |
if [ -z "$(ls -A target/*.jar 2>/dev/null)" ]; then
echo "ERROR: No JAR file found!"
exit 1
fi

- name: Start Spring Boot Application
run: nohup java -jar target/*.jar > app.log 2>&1 &

- name: Wait for API to Start
run: |
for i in {1..30}; do
if curl --silent --fail http://localhost:8080/actuator/health; then
echo "API is up!"
exit 0
fi
echo "Waiting for API..."
sleep 5
done
echo "ERROR: API failed to start."
exit 1
- name: Install Newman and Reporters
run: npm install -g newman newman-reporter-html newman-reporter-json

- name: Ensure Postman Collection Exists
run: |
Expand All @@ -65,14 +52,6 @@ jobs:
exit 1
fi

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install Newman and Reporters
run: npm install -g newman newman-reporter-html newman-reporter-json

- name: Run Newman Tests and Generate Report
run: |
TIMESTAMP=$(date +"%Y-%m-%d")
Expand All @@ -81,6 +60,8 @@ jobs:
--reporters cli,json,html \
--reporter-json-export test-reports/newman-report-$TIMESTAMP.json \
--reporter-html-export test-reports/newman-report-$TIMESTAMP.html
env:
API_BASE_URL: https://sales-agent-3wyf.onrender.com

- name: Upload Test Reports
uses: actions/upload-artifact@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
@RequiredArgsConstructor
public class OpenAIChatService {
private final TelexClient telexClient;
//private final Map<String, List<String>> channelResponses = new ConcurrentHashMap<>();
private final MistralAiChatModel chatModel;
private final ObjectMapper objectMapper;
private final RequestFormatter requestFormatter;
Expand Down