Skip to content

Commit

Permalink
Install pgrx 0.11.1 when building 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
syvb committed Oct 10, 2024
1 parent 9b7fa18 commit 3f073f4
Showing 1 changed file with 30 additions and 34 deletions.
64 changes: 30 additions & 34 deletions pgvectorscale/src/access_method/upgrade_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ pub mod tests {
#[ignore]
///This function is only a mock to bring up the test framewokr in test_delete_vacuum
fn test_upgrade() {
if cfg!(feature = "pg17") {
// PG17 is only supported for one version
return;
}
pgrx_tests::run_test(
"test_delete_mock_fn",
None,
Expand Down Expand Up @@ -73,48 +77,40 @@ pub mod tests {
temp_dir.path()
);

// use latest pgrx
let res = std::process::Command::new("cargo")
.current_dir(temp_path.join("timescale_vector"))
.args(["rm", "pgrx"])
.stdout(Stdio::inherit())
.stderr(Stdio::piped())
.output()
.unwrap();
assert!(res.status.success(), "failed: {:?}", res);

let res = std::process::Command::new("cargo")
.current_dir(temp_path.join("timescale_vector"))
.args(["rm", "--dev", "pgrx-tests"])
.args([
"install",
"cargo-pgrx",
"--version",
"=0.11.1",
"--force",
"--root",
temp_path.join("pgrx-0.11.1").to_str().unwrap(),
"cargo-pgrx",
])
.stdout(Stdio::inherit())
.stderr(Stdio::piped())
.output()
.unwrap();
assert!(res.status.success(), "failed: {:?}", res);

let res = std::process::Command::new("cargo")
.current_dir(temp_path.join("timescale_vector"))
.args(["add", "-F", &format!("pg{}", pg_version), "pgrx"])
.stdout(Stdio::inherit())
.stderr(Stdio::piped())
.output()
.unwrap();
assert!(res.status.success(), "failed: {:?}", res);

//let contents = fs::read_to_string(temp_path.join("pgvectorscale/Cargo.toml")).unwrap();
//print!("cargo {}", contents);

let res = std::process::Command::new("cargo")
.current_dir(temp_path.join("timescale_vector"))
.arg("pgrx")
.arg("install")
.arg("--test")
.arg("--pg-config")
.arg(pg_config.path().unwrap())
.stdout(Stdio::inherit())
.stderr(Stdio::piped())
.output()
.unwrap();
let res = std::process::Command::new(
temp_path
.join("pgrx-0.11.1/bin/cargo-pgrx")
.to_str()
.unwrap(),
)
.current_dir(temp_path.join("timescale_vector"))
.arg("pgrx")
.arg("install")
.arg("--test")
.arg("--pg-config")
.arg(pg_config.path().unwrap())
.stdout(Stdio::inherit())
.stderr(Stdio::piped())
.output()
.unwrap();
assert!(res.status.success(), "failed: {:?}", res);

client
Expand Down

0 comments on commit 3f073f4

Please sign in to comment.