Skip to content

Commit

Permalink
Change masked content
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-asawicki committed Nov 27, 2024
1 parent eb167d2 commit a206c0c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,18 @@ jobs:

- name: Echo multiple lines env content
run: |
echo "it\nworks\nthis way\n.\n!@#$%^&*()_+=-1234567890"
echo "masking does not\nwork this way.\n!@#$%^&*()_+=-1234567890"
echo "$TEST_SF_TF_MULTI_LINER"
env:
TEST_SF_TF_MULTI_LINER: ${{ secrets.TEST_SF_TF_MULTI_LINER }}

- name: Echo different lines from all lines env
run: |
echo "different space-separated"
echo "really, really,"
echo "really"
echo "really, really, really"
echo "secret infos"
echo "really, really,"
echo "different space-separated really, really, really secret infos"
echo "really, really,"
echo "different"
echo "infos"
echo "$TEST_SF_TF_ALL_LINES"
Expand Down
17 changes: 7 additions & 10 deletions pkg/experiments/experiment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,26 +79,23 @@ func Test_experiments(t *testing.T) {
})

// This test assumes that TEST_SF_TF_MULTI_LINER is set to:
// it
// works
// this way
// .
// masking does not
// work this way.
// !@#$%^&*()_+=-1234567890
t.Run("masking from multi line env", func(t *testing.T) {
testenvs.AssertEnvSet(t, "TEST_SF_TF_MULTI_LINER")

value := os.Getenv("TEST_SF_TF_MULTI_LINER")

t.Log(value)
t.Log("it\nworks\nthis way\n.\n!@#$%^&*()_+=-1234567890")
t.Log("it works this way . !@#$%^&*()_+=-1234567890")
t.Log("it works")
t.Log("masking does not\nwork this way.\n!@#$%^&*()_+=-1234567890")
t.Log("masking does not work this way. !@#$%^&*()_+=-1234567890")
t.Log("masking does not")
})

// This test assumes that TEST_SF_TF_ALL_LINES is set to:
// different space-separated
// really, really,
// really
// really, really, really
// secret infos
t.Run("masking all lines from env", func(t *testing.T) {
testenvs.AssertEnvSet(t, "TEST_SF_TF_ALL_LINES")
Expand All @@ -107,7 +104,7 @@ func Test_experiments(t *testing.T) {

t.Log(value)
t.Log("different space-separated really, really, really secret infos")
t.Log("different space-separatedreally, really,reallysecret infos")
t.Log("different space-separatedreally, really, reallysecret infos")

output := echoWithOutput(t, value)
assert.NotEqual(t, "***\n***\n***\n***", output)
Expand Down

0 comments on commit a206c0c

Please sign in to comment.