Skip to content

Commit 351e6b3

Browse files
committed
ci(tests):use localhost instead of ip for curls
1 parent 192192e commit 351e6b3

File tree

1 file changed

+11
-22
lines changed

1 file changed

+11
-22
lines changed

.github/workflows/tests.yml

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -61,41 +61,30 @@ jobs:
6161
echo "Validating 'web.conf' file creation"
6262
docker exec -i ${{ job.services.splunk.id }} ls -a /opt/splunk/etc/system/local/
6363
64-
- name: Set container IP as env variable
65-
run: |
66-
echo "SPLUNK_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${{ job.services.splunk.id }})" >> $GITHUB_ENV
64+
# - name: Set container IP as env variable
65+
# run: |
66+
# echo "SPLUNK_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${{ job.services.splunk.id }})" >> $GITHUB_ENV
6767

6868
- name: Restart instance
6969
run: |
70-
curl -k -u admin:password https://$SPLUNK_IP:8089/services/server/control/restart -X POST
70+
curl -k -u admin:password https://localhost:8089/services/server/control/restart -X POST
71+
# curl -k -u admin:password https://$SPLUNK_IP:8089/services/server/control/restart -X POST
7172
sleep 30
7273
7374
- name: Configure MLTK permissions
7475
run: |
75-
curl --retry-delay 5 --retry 5 -f -k -u admin:password https://$SPLUNK_IP:8089/services/apps/local/Splunk_ML_Toolkit/acl -d sharing=global -d owner=nobody -X POST
76+
curl --retry-delay 5 --retry 5 -f -k -u admin:password https://localhost:8089/services/apps/local/Splunk_ML_Toolkit/acl -d sharing=global -d owner=nobody -X POST
77+
# curl --retry-delay 5 --retry 5 -f -k -u admin:password https://$SPLUNK_IP:8089/services/apps/local/Splunk_ML_Toolkit/acl -d sharing=global -d owner=nobody -X POST
7678
echo "Check MLTK permissions"
77-
curl -k -u admin:password https://$SPLUNK_IP:8089/services/apps/local/Splunk_ML_Toolkit/acl?output_mode=json | jq -r '.entry | .[].acl.sharing'
79+
curl -k -u admin:password https://localhost:8089/services/apps/local/Splunk_ML_Toolkit/acl?output_mode=json | jq -r '.entry | .[].acl.sharing'
80+
# curl -k -u admin:password https://$SPLUNK_IP:8089/services/apps/local/Splunk_ML_Toolkit/acl?output_mode=json | jq -r '.entry | .[].acl.sharing'
7881
7982
# - name: Tests execution prep
8083
# run: |
8184
# echo "Removing package-lock to avoid issues with splunk artifactory"
8285
# cd test
8386
# rm -rf package-lock.json
8487
# npm install
85-
# - name: Wait for Splunk Web UI to be fully ready
86-
# run: |
87-
# echo "Waiting for Splunk Web UI at http://$SPLUNK_IP:8000/en-US/account/login"
88-
# # Try for up to 60 * 5 = 300 seconds (5 minutes)
89-
# for i in $(seq 1 60); do
90-
# if curl -s -f http://$SPLUNK_IP:8000/en-US/account/login; then
91-
# echo "Splunk Web UI is ready!"
92-
# exit 0
93-
# fi
94-
# echo "Splunk Web UI not ready yet, waiting 5 seconds... (Attempt $i/60)"
95-
# sleep 5
96-
# done
97-
# echo "Error: Splunk Web UI did not become ready within 5 minutes."
98-
# exit 1
9988

10089
- name: Cypress run
10190
uses: cypress-io/github-action@v6
@@ -107,10 +96,10 @@ jobs:
10796
ELECTRON_EXTRA_LAUNCH_ARGS: --disable-gpu
10897
with:
10998
# start: npm run test
110-
wait-on: 'http://$SPLUNK_IP:8000'
99+
wait-on: 'http://localhost:8000'
111100
# No videos can be recorded w/ ff as per https://github.com/cypress-io/cypress/issues/18415
112101
# browser: firefox
113-
config: baseUrl=http://$SPLUNK_IP:8000
102+
# config: baseUrl=http://$SPLUNK_IP:8000
114103
working-directory: test
115104

116105
# - name: Verify results availability

0 commit comments

Comments
 (0)