Skip to content

Commit 4133e0d

Browse files
committed
add post-release smoke tests for installation from cargo & maven
1 parent 759269d commit 4133e0d

7 files changed

Lines changed: 151 additions & 0 deletions

File tree

test/MavenSmokeTest/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target/

test/MavenSmokeTest/pom.xml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>net.mlin.genomicsqlite</groupId>
8+
<artifactId>MavenSmokeTest</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
11+
<name>MavenSmokeTest</name>
12+
<!-- FIXME change it to the project's website -->
13+
<url>http://www.example.com</url>
14+
15+
<properties>
16+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17+
<maven.compiler.source>1.7</maven.compiler.source>
18+
<maven.compiler.target>1.7</maven.compiler.target>
19+
</properties>
20+
21+
<repositories>
22+
<repository>
23+
<id>genomicsqlite-jdbc</id>
24+
<url>https://raw.githubusercontent.com/wiki/mlin/GenomicSQLite/mvn-repo/</url>
25+
</repository>
26+
</repositories>
27+
28+
<dependencies>
29+
<dependency>
30+
<groupId>net.mlin</groupId>
31+
<artifactId>genomicsqlite-jdbc</artifactId>
32+
<version>v${GENOMICSQLITE_VERSION}</version>
33+
</dependency>
34+
</dependencies>
35+
36+
<build>
37+
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
38+
<plugins>
39+
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
40+
<plugin>
41+
<artifactId>maven-clean-plugin</artifactId>
42+
<version>3.1.0</version>
43+
</plugin>
44+
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
45+
<plugin>
46+
<artifactId>maven-resources-plugin</artifactId>
47+
<version>3.0.2</version>
48+
</plugin>
49+
<plugin>
50+
<artifactId>maven-compiler-plugin</artifactId>
51+
<version>3.8.0</version>
52+
</plugin>
53+
<plugin>
54+
<artifactId>maven-surefire-plugin</artifactId>
55+
<version>2.22.1</version>
56+
</plugin>
57+
<plugin>
58+
<artifactId>maven-jar-plugin</artifactId>
59+
<version>3.0.2</version>
60+
</plugin>
61+
<plugin>
62+
<artifactId>maven-install-plugin</artifactId>
63+
<version>2.5.2</version>
64+
</plugin>
65+
<plugin>
66+
<artifactId>maven-deploy-plugin</artifactId>
67+
<version>2.8.2</version>
68+
</plugin>
69+
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
70+
<plugin>
71+
<artifactId>maven-site-plugin</artifactId>
72+
<version>3.7.1</version>
73+
</plugin>
74+
<plugin>
75+
<artifactId>maven-project-info-reports-plugin</artifactId>
76+
<version>3.0.0</version>
77+
</plugin>
78+
</plugins>
79+
</pluginManagement>
80+
</build>
81+
</project>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package net.mlin.genomicsqlite;
2+
import java.sql.Connection;
3+
import java.sql.DriverManager;
4+
import java.sql.SQLException;
5+
import net.mlin.genomicsqlite.GenomicSQLite;
6+
7+
/**
8+
* Hello world!
9+
*
10+
*/
11+
public class MavenSmokeTest
12+
{
13+
public static void main( String[] args ) throws SQLException
14+
{
15+
String url =
16+
"jdbc:genomicsqlite:/tmp/GenomicSQLiteJDBC." + java.util.UUID.randomUUID().toString();
17+
Connection conn = DriverManager.getConnection(url);
18+
System.out.println("GenomicSQLite " + GenomicSQLite.version(conn));
19+
}
20+
}

test/cargo_smoke_test/.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Generated by Cargo
2+
# will have compiled files and executables
3+
debug/
4+
target/
5+
6+
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
7+
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
8+
Cargo.lock
9+
10+
# These are backup files generated by rustfmt
11+
**/*.rs.bk
12+
13+
# Cargo.toml is generated from Cargo.toml.in by ./cargo
14+
Cargo.toml
15+
libgenomicsqlite.*
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[package]
2+
name = "cargo_smoke_test"
3+
version = "0.0.1"
4+
authors = ["Mike Lin <dna@mlin.net>"]
5+
edition = "2018"
6+
7+
[dependencies]
8+
genomicsqlite = "{{GENOMICSQLITE_VERSION}}"
9+
rusqlite = "^0.24"
10+
json = "^0"

test/cargo_smoke_test/cargo

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
# wrapper for cargo that generates Cargo.toml from Cargo.toml.in, filling in git revision as
3+
# crate version
4+
set -e
5+
cd `dirname $0`
6+
7+
revision="$(git describe --tags --dirty)"
8+
revision="${revision#v}" # strip 'v' prefix
9+
>&2 echo "$revision"
10+
11+
sed "s/{{GENOMICSQLITE_VERSION}}/${revision}/" Cargo.toml.in > Cargo.toml
12+
cargo "$@"

test/cargo_smoke_test/src/main.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
use genomicsqlite::ConnectionMethods;
2+
use rusqlite::{Connection, OpenFlags};
3+
4+
fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
5+
let dbconn: Connection = genomicsqlite::open(
6+
":memory:",
7+
OpenFlags::SQLITE_OPEN_CREATE | OpenFlags::SQLITE_OPEN_READ_WRITE,
8+
&json::object::Object::new(),
9+
)?;
10+
println!("GenomicSQLite {}", dbconn.genomicsqlite_version());
11+
Ok(())
12+
}

0 commit comments

Comments
 (0)