File tree Expand file tree Collapse file tree
write-program-buffer/tests/integration Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 integration :
2121 name : ${{ matrix.scenario }} (solana ${{ matrix.solana-version }})
2222 runs-on : ubuntu-latest
23+ timeout-minutes : 10
2324 strategy :
2425 fail-fast : false
2526 matrix :
Original file line number Diff line number Diff line change 3434 LEDGER_DIR="${RUNNER_TEMP:-/tmp}/test-ledger"
3535 fi
3636
37- rm -rf "$LEDGER_DIR"
3837 solana-test-validator --reset --quiet --ledger "$LEDGER_DIR" > "${RUNNER_TEMP:-/tmp}/validator-stdout.log" 2>&1 &
3938 echo "Validator started with PID $!"
4039
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ fail() {
1212[ -n " ${BUFFER:- } " ] || fail " action did not output a buffer address"
1313[ -n " ${BUFFER_AUTHORITY:- } " ] || fail " BUFFER_AUTHORITY env not set"
1414[ -n " ${DEPLOYER:- } " ] || fail " DEPLOYER env not set"
15+ [ -n " ${PROGRAM_ID:- } " ] || fail " PROGRAM_ID env not set"
16+ [ -n " ${PRE_LEN:- } " ] || fail " PRE_LEN env not set"
1517
1618BUFFER_INFO=$( solana program show " $BUFFER " -u " $RPC_URL " )
1719echo " $BUFFER_INFO "
@@ -20,9 +22,13 @@ AUTHORITY=$(echo "$BUFFER_INFO" | grep "Authority:" | awk '{print $2}' || true)
2022[ " $AUTHORITY " = " $BUFFER_AUTHORITY " ] || fail " buffer authority is $AUTHORITY , expected $BUFFER_AUTHORITY "
2123[ " $AUTHORITY " != " $DEPLOYER " ] || fail " buffer authority still equals the deployer"
2224
25+ POST_LEN=$( solana program show " $PROGRAM_ID " -u " $RPC_URL " | grep " Data Length:" | sed -E ' s/.*Data Length: ([0-9]+).*/\1/' | cut -d ' ' -f1 || true)
26+ [ -n " $POST_LEN " ] || fail " could not read data length of program $PROGRAM_ID "
27+ [ " $POST_LEN " -eq " $PRE_LEN " ] || fail " program was resized from $PRE_LEN to $POST_LEN bytes, expected no resize"
28+
2329DUMP=" $( mktemp) "
2430solana program dump " $BUFFER " " $DUMP " -u " $RPC_URL " || fail " could not dump buffer $BUFFER "
2531cmp -s " $ARTIFACT " " $DUMP " || fail " buffer contents differ from artifact"
2632rm -f " $DUMP "
2733
28- echo " Authority transfer assertions passed"
34+ echo " Authority transfer assertions passed: program stayed at $PRE_LEN bytes "
Original file line number Diff line number Diff line change @@ -28,12 +28,19 @@ solana program deploy "$FIXTURES_DIR/program-small.so" \
2828 -u " $RPC_URL " -k " $SCENARIO_DIR /deployer.json" \
2929 --commitment confirmed
3030
31+ PRE_LEN=$( solana program show " $PROGRAM_ID " -u " $RPC_URL " | grep " Data Length:" | sed -E ' s/.*Data Length: ([0-9]+).*/\1/' | cut -d ' ' -f1 || true)
32+ if [ -z " $PRE_LEN " ]; then
33+ echo " Could not read deployed program size" >&2
34+ exit 1
35+ fi
36+
3137cp " $FIXTURES_DIR /program-small.so" target/deploy/fixture-authority.so
3238
33- echo " Prepared authority scenario: deployer=$DEPLOYER program-id=$PROGRAM_ID authority-target=$AUTHORITY_TARGET "
39+ echo " Prepared authority scenario: deployer=$DEPLOYER program-id=$PROGRAM_ID authority-target=$AUTHORITY_TARGET pre-len= $PRE_LEN "
3440{
3541 echo " keypair=$( cat " $SCENARIO_DIR /deployer.json" ) "
3642 echo " deployer=$DEPLOYER "
3743 echo " program-id=$PROGRAM_ID "
3844 echo " buffer-authority=$AUTHORITY_TARGET "
45+ echo " pre-len=$PRE_LEN "
3946} >> " $GITHUB_OUTPUT "
You can’t perform that action at this time.
0 commit comments