Skip to content

Commit da36c84

Browse files
authored
[SYNPY-1592] Update Synapse login to specify profile in deletion scripts and integration test scripts (#1240)
1 parent 0b11782 commit da36c84

File tree

7 files changed

+54
-4
lines changed

7 files changed

+54
-4
lines changed

.github/scripts/delete_evaluations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from synapseclient import Evaluation, Synapse
55

66
syn = Synapse()
7-
syn.login()
7+
syn.login(profile=None)
88

99
# Maximum number of concurrent deletion operations
1010
MAX_CONCURRENT_DELETIONS = 5

.github/scripts/delete_projects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from synapseclient import Synapse
55

66
syn = Synapse()
7-
syn.login()
7+
syn.login(profile=None)
88

99
# Maximum number of concurrent deletion operations
1010
MAX_CONCURRENT_DELETIONS = 5

.github/scripts/delete_teams.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from synapseclient import Synapse
55

66
syn = Synapse()
7-
syn.login()
7+
syn.login(profile=None)
88

99
# Maximum number of concurrent team deletions
1010
MAX_CONCURRENT_DELETIONS = 5

.github/scripts/empty_trash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from synapseclient import Synapse
55

66
syn = Synapse()
7-
syn.login()
7+
syn.login(profile=None)
88

99
# Maximum number of concurrent deletion operations
1010
MAX_CONCURRENT_DELETIONS = 5

.github/workflows/build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,29 @@ jobs:
135135
# keep versions consistent with the first and last from the strategy matrix
136136
if: ${{ (contains(fromJSON('["3.9"]'), matrix.python) || contains(fromJSON('["3.13"]'), matrix.python)) && steps.secret-check.outputs.secrets_available == 'true'}}
137137
run: |
138+
# Set SYNAPSE_PROFILE based on OS and Python version
139+
if [ "${{ startsWith(matrix.os, 'ubuntu') }}" == "true" ]; then
140+
if [ "${{ matrix.python }}" == "3.9" ]; then
141+
export SYNAPSE_PROFILE="TestUbuntuMinimumPython"
142+
elif [ "${{ matrix.python }}" == "3.13" ]; then
143+
export SYNAPSE_PROFILE="TestUbuntuMaximumPython"
144+
fi
145+
elif [ "${{ startsWith(matrix.os, 'windows') }}" == "true" ]; then
146+
if [ "${{ matrix.python }}" == "3.9" ]; then
147+
export SYNAPSE_PROFILE="TestWindowsMinimumPython"
148+
elif [ "${{ matrix.python }}" == "3.13" ]; then
149+
export SYNAPSE_PROFILE="TestWindowsMaximumPython"
150+
fi
151+
elif [ "${{ startsWith(matrix.os, 'macos') }}" == "true" ]; then
152+
if [ "${{ matrix.python }}" == "3.9" ]; then
153+
export SYNAPSE_PROFILE="TestMacosMinimumPython"
154+
elif [ "${{ matrix.python }}" == "3.13" ]; then
155+
export SYNAPSE_PROFILE="TestMacosMaximumPython"
156+
fi
157+
fi
158+
159+
echo "Using SYNAPSE_PROFILE: $SYNAPSE_PROFILE"
160+
138161
# decrypt the encrypted test synapse configuration
139162
openssl aes-256-cbc -K ${{ secrets.encrypted_d17283647768_key }} -iv ${{ secrets.encrypted_d17283647768_iv }} -in test.synapseConfig.enc -out test.synapseConfig -d
140163
mv test.synapseConfig ~/.synapseConfig

.github/workflows/test-cleanup.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ jobs:
1313
permissions:
1414
contents: read
1515

16+
strategy:
17+
matrix:
18+
synapse_profile:
19+
- "TestUbuntuMinimumPython"
20+
- "TestUbuntuMaximumPython"
21+
- "TestWindowsMinimumPython"
22+
- "TestWindowsMaximumPython"
23+
- "TestMacosMinimumPython"
24+
- "TestMacosMaximumPython"
25+
- "" # Empty string for default profile (no SYNAPSE_PROFILE set)
26+
1627
steps:
1728
- name: Checkout repository
1829
uses: actions/checkout@v4
@@ -67,17 +78,33 @@ jobs:
6778
mv test.synapseConfig ~/.synapseConfig
6879
6980
- name: Run evaluation deletion script
81+
shell: bash
7082
run: |
83+
if [ -n "${{ matrix.synapse_profile }}" ]; then
84+
export SYNAPSE_PROFILE="${{ matrix.synapse_profile }}"
85+
fi
7186
python .github/scripts/delete_evaluations.py
7287
7388
- name: Run project deletion script
89+
shell: bash
7490
run: |
91+
if [ -n "${{ matrix.synapse_profile }}" ]; then
92+
export SYNAPSE_PROFILE="${{ matrix.synapse_profile }}"
93+
fi
7594
python .github/scripts/delete_projects.py
7695
7796
- name: Run team deletion script
97+
shell: bash
7898
run: |
99+
if [ -n "${{ matrix.synapse_profile }}" ]; then
100+
export SYNAPSE_PROFILE="${{ matrix.synapse_profile }}"
101+
fi
79102
python .github/scripts/delete_teams.py
80103
81104
- name: Run empty trash script
105+
shell: bash
82106
run: |
107+
if [ -n "${{ matrix.synapse_profile }}" ]; then
108+
export SYNAPSE_PROFILE="${{ matrix.synapse_profile }}"
109+
fi
83110
python .github/scripts/empty_trash.py

test.synapseConfig.enc

5 KB
Binary file not shown.

0 commit comments

Comments
 (0)