Skip to content

Commit

Permalink
pb-rust: re-enable test suite
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Leightcap <jack.leightcap@trailofbits.com>
  • Loading branch information
jleightcap committed Aug 7, 2023
1 parent f21f9ef commit 1b22bff
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/rust-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,17 @@ jobs:
- run: |
cd gen/pb-rust
cargo build --verbose
test:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable

steps:
- uses: actions/checkout@v3
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: |
cd gen/pb-rust
cargo test --tests
5 changes: 2 additions & 3 deletions gen/pb-rust/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use pretty_assertions::{assert_eq, assert_ne};
use serde_json;
use sigstore_protobuf_specs::{
Bundle, DevSigstoreBundleV1VerificationMaterial as VerificationMaterial,
DevSigstoreCommonV1HashOutput as HashOutput,
DevSigstoreCommonV1HashOutputAlgorithm as HashAlgorithm, DevSigstoreCommonV1LogId as LogId,
DevSigstoreCommonV1HashOutput as HashOutput, DevSigstoreCommonV1LogId as LogId,
DevSigstoreCommonV1MessageSignature as MessageSignature,
DevSigstoreCommonV1X509Certificate as X509Certificate,
DevSigstoreCommonV1X509CertificateChain as X509CertificateChain,
Expand Down Expand Up @@ -75,7 +74,7 @@ fn bundle() {
}),
message_signature: Some(MessageSignature {
message_digest: Some(HashOutput{
algorithm: Some(HashAlgorithm::Variant0(String::from("SHA2_256"))),
algorithm: Some(String::from("SHA2_256")),
digest: Some(String::from("gC3WD/iDM4AvJYXnMEO9IcNBKF4Zkv5bMXVeHK3q4w4="))
}),
signature: Some(String::from("MGUCMQCOOJqTY6XWgB64izK2WVP07b0SG9M5WPCwKhfTPwMvtsgUi8KeRGwQkvvLYbKHdqUCMEbOXFG0NMqEQxWVb6rmGnexdADuGf6Jl8qAC8tn67p3QfVoXzMvFA61PzxwVwvb8g=="))
Expand Down
5 changes: 2 additions & 3 deletions gen/pb-rust/tests/unit.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
use sigstore_protobuf_specs::{
DevSigstoreCommonV1HashOutput as HashOutput,
DevSigstoreCommonV1HashOutputAlgorithm as HashAlgorithm,
DevSigstoreCommonV1MessageSignature as MessageSignature,
};

/// HashOutput, a structure using only primitive types
#[test]
fn primitives() {
let hash_output = HashOutput {
algorithm: Some(HashAlgorithm::Variant0(String::from("SHA2_256"))),
algorithm: Some(String::from("SHA2_256")),
digest: Some(String::from("gC3WD/iDM4AvJYXnMEO9IcNBKF4Zkv5bMXVeHK3q4w4=")),
};

Expand All @@ -25,7 +24,7 @@ fn primitives() {
fn nested() {
let message_signature= MessageSignature {
message_digest: Some(HashOutput {
algorithm: Some(HashAlgorithm::Variant0(String::from("SHA_256"))),
algorithm: Some(String::from("SHA_256")),
digest: Some(String::from("gC3WD/iDM4AvJYXnMEO9IcNBKF4Zkv5bMXVeHK3q4w4=")),
}),
signature: Some(String::from("MGUCMQCOOJqTY6XWgB64izK2WVP07b0SG9M5WPCwKhfTPwMvtsgUi8KeRGwQkvvLYbKHdqUCMEbOXFG0NMqEQxWVb6rmGnexdADuGf6Jl8qAC8tn67p3QfVoXzMvFA61PzxwVwvb8g=="))
Expand Down

0 comments on commit 1b22bff

Please sign in to comment.