Skip to content

Commit

Permalink
cli: Remove dependencies on built programs in tests (#5027)
Browse files Browse the repository at this point in the history
* token-upgrade-cli: Remove token, token-2022, and ata from test

* single-pool-cli: Remove token and ATA from test

* Also remove the program builds from CI
  • Loading branch information
joncinque authored Aug 15, 2023
1 parent 460fbd7 commit cd2c406
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 43 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/pull-request-single-pool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ jobs:
- name: Build dependent programs
run: |
cargo build-sbf --manifest-path=token/program/Cargo.toml
cargo build-sbf --manifest-path=associated-token-account/program/Cargo.toml
cargo build-sbf --manifest-path=single-pool/program/Cargo.toml
- name: Build and test
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/pull-request-token-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ jobs:
- name: Build dependent programs
run: |
cargo build-sbf --manifest-path ./token/program/Cargo.toml
cargo build-sbf --manifest-path ./token/program-2022/Cargo.toml
cargo build-sbf --manifest-path ./associated-token-account/program/Cargo.toml
cargo build-sbf --manifest-path ./token-upgrade/program/Cargo.toml
- name: Run CLI tests
Expand Down
12 changes: 0 additions & 12 deletions single-pool/cli/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,6 @@ async fn start_validator() -> (TestValidator, Keypair) {
));

test_validator_genesis.add_upgradeable_programs_with_path(&[
UpgradeableProgramInfo {
program_id: spl_token::id(),
loader: bpf_loader_upgradeable::id(),
program_path: PathBuf::from("../../target/deploy/spl_token.so"),
upgrade_authority: Pubkey::default(),
},
UpgradeableProgramInfo {
program_id: spl_associated_token_account::id(),
loader: bpf_loader_upgradeable::id(),
program_path: PathBuf::from("../../target/deploy/spl_associated_token_account.so"),
upgrade_authority: Pubkey::default(),
},
UpgradeableProgramInfo {
program_id: Pubkey::from_str("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s").unwrap(),
loader: bpf_loader_upgradeable::id(),
Expand Down
32 changes: 6 additions & 26 deletions token-upgrade/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,32 +504,12 @@ mod test {
async fn new_validator_for_test() -> (TestValidator, Keypair) {
solana_logger::setup();
let mut test_validator_genesis = TestValidatorGenesis::default();
test_validator_genesis.add_upgradeable_programs_with_path(&[
UpgradeableProgramInfo {
program_id: spl_token::id(),
loader: bpf_loader_upgradeable::id(),
program_path: PathBuf::from("../../target/deploy/spl_token.so"),
upgrade_authority: Pubkey::new_unique(),
},
UpgradeableProgramInfo {
program_id: spl_associated_token_account::id(),
loader: bpf_loader_upgradeable::id(),
program_path: PathBuf::from("../../target/deploy/spl_associated_token_account.so"),
upgrade_authority: Pubkey::new_unique(),
},
UpgradeableProgramInfo {
program_id: spl_token_2022::id(),
loader: bpf_loader_upgradeable::id(),
program_path: PathBuf::from("../../target/deploy/spl_token_2022.so"),
upgrade_authority: Pubkey::new_unique(),
},
UpgradeableProgramInfo {
program_id: spl_token_upgrade::id(),
loader: bpf_loader_upgradeable::id(),
program_path: PathBuf::from("../../target/deploy/spl_token_upgrade.so"),
upgrade_authority: Pubkey::new_unique(),
},
]);
test_validator_genesis.add_upgradeable_programs_with_path(&[UpgradeableProgramInfo {
program_id: spl_token_upgrade::id(),
loader: bpf_loader_upgradeable::id(),
program_path: PathBuf::from("../../target/deploy/spl_token_upgrade.so"),
upgrade_authority: Pubkey::new_unique(),
}]);
test_validator_genesis.start_async().await
}

Expand Down

0 comments on commit cd2c406

Please sign in to comment.