Skip to content

test action on itself #27

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

Draft
wants to merge 45 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
20fe1b5
test action on itself
oycyc May 12, 2025
604e84d
main() to use the util funcs
oycyc May 12, 2025
8c624bd
narrow down further
oycyc May 13, 2025
f64bee2
Merge branch 'main' into refactor/use-json-output
oycyc May 13, 2025
b2b1770
shouldn't be executing the test package
oycyc May 13, 2025
4574b8c
trigger test
oycyc May 13, 2025
f3f5f34
using new
oycyc May 13, 2025
878bde5
package coverage
oycyc May 14, 2025
e3c7af5
dirty but functional
oycyc May 14, 2025
c519c86
using coverage test
oycyc May 14, 2025
6d1e0aa
get rid of bash script
oycyc May 14, 2025
251200a
remove naive coverage processing
oycyc May 14, 2025
1ab3758
rename interface to ProcessedCoverageResults
oycyc May 14, 2025
858b637
Revert "rename interface to ProcessedCoverageResults"
oycyc May 14, 2025
69f7ab4
rename coverage result to processedcoveragereusult
oycyc May 14, 2025
c23eac3
npm run build
oycyc May 14, 2025
522365b
test what happens when one failed test
oycyc May 14, 2025
9ef3f6f
add exit code in logs to test
oycyc May 14, 2025
afbf605
test exit code for main test
oycyc May 14, 2025
ee4616a
update comment tag with env github actions in case multiple tests wih…
oycyc May 14, 2025
6360521
what env vars is there acccesisble from top level composite func
oycyc May 14, 2025
b1d0cc6
it's not on there?
oycyc May 14, 2025
098740f
Debugging
oycyc May 14, 2025
3a32c30
printenv
oycyc May 14, 2025
6592747
let's see if this outputs properly
oycyc May 14, 2025
964e75b
explain why
oycyc May 14, 2025
96b04b1
test latest opa version
oycyc May 14, 2025
aedb010
is new syntax backwards compatibale
oycyc May 14, 2025
ba5b432
clean up result processor
oycyc May 15, 2025
2f248fe
v0 compatibality test
oycyc May 15, 2025
de2dc20
ignore return code and use exit code
oycyc May 15, 2025
e4c6cb0
var file flag
oycyc May 15, 2025
46049ff
remove unused flag
oycyc May 15, 2025
e06a8f9
test local action with test mode
oycyc May 20, 2025
01fb1c5
fix test
oycyc May 20, 2025
bedae88
test additional policies
oycyc May 20, 2025
51c01fe
coverage only if
oycyc May 20, 2025
69af1bd
use correct rego file
oycyc May 20, 2025
452f2e5
bring back tests
oycyc May 20, 2025
4d30ded
test directory mode with examples dir
oycyc May 24, 2025
2b3491a
hmm i'm confused
oycyc May 24, 2025
97f5825
now does this workgit add .
oycyc May 24, 2025
f3f6c14
try without try catch??
oycyc May 24, 2025
4bd12f4
use try catch then
oycyc May 24, 2025
4f78690
test new refactor
oycyc May 24, 2025
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
16 changes: 13 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,20 @@ jobs:
id: checkout
uses: actions/checkout@v4

- name: Test Local Action
id: test-action
- name: Test Local Action (Individual File Mode)
id: test-action-opa-files
uses: ./
with:
path: ./examples
test_mode: file
report_untested_files: true
pr_comment_title: Below is the Action testing on itself with this PR's source code against the `/examples` directory. Confirm it is as expected.
pr_comment_title: Below is the Action testing on itself with this PR's source code against policies in `/examples` file by file. Confirm it is as expected.

- name: Test Local Action (Directory Package Mode)
id: test-action-opa-package
uses: ./
with:
path: ./examples
test_mode: directory
report_untested_files: true
pr_comment_title: Below is the Action testing on itself with this PR's source code against `/spacelift_policies` entire package directory. Confirm it is as expected.
30 changes: 30 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{

Check failure on line 1 in .vscode/launch.json

View workflow job for this annotation

GitHub Actions / Trunk Check

prettier

Incorrect formatting, autoformat by running 'trunk fmt'
"version": "1.0.0",
"configurations": [
{
"name": "TS-Node",
"type": "node",
"request": "launch",
"runtimeExecutable": "npx",
"runtimeArgs": [
"ts-node",
"./src/index.ts",
// "--transpile-only",
// if you use esm
// "--esm"
],
// "program": "${file}",
// "program": "${workspaceRoot}/src/index.ts",
// "cwd": "${workspaceRoot}",
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": ["<node_internals>/**", "node_modules/**"],
"env": {
"path": "./examples", // Replace with your actual path
"test_file_postfix": "_test", // Replace with your actual postfix,
"test_mode": "directory"
// You can add more environment variables here
// "ANOTHER_VAR": "another_value"
}
}
]
}
Loading
Loading