Add tests for private repo access with token …
- Created 2 entry points for running either the action or the tests - Added test for proving token access to a private repo - Added some default test data
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
# custom
|
||||
test_key.txt
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"workbench.colorCustomizations": {
|
||||
"activityBar.activeBackground": "#2f7c47",
|
||||
"activityBar.activeBorder": "#422c74",
|
||||
"activityBar.background": "#2f7c47",
|
||||
"activityBar.foreground": "#e7e7e7",
|
||||
"activityBar.inactiveForeground": "#e7e7e799",
|
||||
"activityBarBadge.background": "#422c74",
|
||||
"activityBarBadge.foreground": "#e7e7e7",
|
||||
"statusBar.background": "#215732",
|
||||
"statusBar.foreground": "#e7e7e7",
|
||||
"statusBarItem.hoverBackground": "#2f7c47",
|
||||
"titleBar.activeBackground": "#215732",
|
||||
"titleBar.activeForeground": "#e7e7e7",
|
||||
"titleBar.inactiveBackground": "#21573299",
|
||||
"titleBar.inactiveForeground": "#e7e7e799"
|
||||
},
|
||||
"peacock.color": "#215732"
|
||||
}
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
# TODO: SPIKE on running 'live' tests through the action runner
|
||||
|
||||
# TODO: update local mode vars to be a good functional example
|
||||
# Set custom vars for LOCAL MODE run of action
|
||||
if [ -z "${GITHUB_ACTIONS}" ] || [ "${GITHUB_ACTIONS}" = false ]; then
|
||||
echo "Running action in LOCAL MODE..."
|
||||
INPUT_GITHUB_TOKEN="$(cat ../test_key.txt)"
|
||||
fi
|
||||
|
||||
: '
|
||||
TODO: determine how to actually run this locally:
|
||||
- place project inside the target repo?
|
||||
- add var for path to repo?
|
||||
- perform target repo checkout inside this project to perform actions?
|
||||
'
|
||||
|
||||
# . ../run/token_access.sh
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
SUCCESS_TEST_REPO="aoAppDev/action-test-access-repo.git"
|
||||
TEST_ACCESS_TOKEN=$(cat ../test_key.txt)
|
||||
|
||||
FAIL_TEST_REPO="aoAppDev/action-test-access-fail-case.git"
|
||||
|
||||
echo "Running action in TEST MODE..."
|
||||
. ../run/token_access.sh && run_tests
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"workbench.colorCustomizations": {
|
||||
"activityBar.activeBackground": "#2f7c47",
|
||||
"activityBar.activeBorder": "#422c74",
|
||||
"activityBar.background": "#2f7c47",
|
||||
"activityBar.foreground": "#e7e7e7",
|
||||
"activityBar.inactiveForeground": "#e7e7e799",
|
||||
"activityBarBadge.background": "#422c74",
|
||||
"activityBarBadge.foreground": "#e7e7e7",
|
||||
"statusBar.background": "#215732",
|
||||
"statusBar.foreground": "#e7e7e7",
|
||||
"statusBarItem.hoverBackground": "#2f7c47",
|
||||
"titleBar.activeBackground": "#215732",
|
||||
"titleBar.activeForeground": "#e7e7e7",
|
||||
"titleBar.inactiveBackground": "#21573299",
|
||||
"titleBar.inactiveForeground": "#e7e7e799"
|
||||
},
|
||||
"peacock.color": "#215732"
|
||||
}
|
||||
}
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
# TODO: rename file based on action/purpose
|
||||
# TODO: extract user-adjustable vars into superscript for test runs
|
||||
|
||||
|
||||
# TODO:improve console output
|
||||
# Run with local test values - adjustable in `entry/run_tests.sh`
|
||||
run_tests() {
|
||||
echo "Token access test 1 -> Try to clone private repo with no access token / git clone should fail"
|
||||
(git clone https://github.com/${FAIL_TEST_REPO} && \
|
||||
# (git clone https://github.com/aoAppDev/action-test-access-fail-case.git && \
|
||||
echo "Test 1 FAIL - git clone should failed") || \
|
||||
echo "Test 1 PASSED - git clone failed as expected"
|
||||
|
||||
echo "Token access test 2 -> Try to clone private repo with access token / git clone should succeed"
|
||||
(git clone https://${TEST_ACCESS_TOKEN}@github.com/${SUCCESS_TEST_REPO} && \
|
||||
# (git clone https://${INPUT_GITHUB_TOKEN}@github.com/aoAppDev/action-test-access-repo.git && \
|
||||
echo "Test 2 PASSED - git clone succeeded as expected") || \
|
||||
echo "Test 2 FAILED - git clone should have succeeded"
|
||||
|
||||
# TODO: clean up cloned repo (now? or after later tests?)
|
||||
}
|
||||
Reference in New Issue
Block a user