Merge pull request #62 from arik-so/2023/10/ordering_fix
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Sun, 15 Oct 2023 19:54:49 +0000 (19:54 +0000)
committerGitHub <noreply@github.com>
Sun, 15 Oct 2023 19:54:49 +0000 (19:54 +0000)
Create Postgres step in CI.

.github/workflows/build.yml
src/tests/mod.rs

index aca2d244fcde56b7ea9bb0392619c90a1e5929d8..7a614ec4ed82e170c83e987953188413ec5f62aa 100644 (file)
@@ -7,6 +7,10 @@ on:
     branches:
       - "*"
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
 jobs:
   build:
     strategy:
@@ -29,3 +33,35 @@ jobs:
       - name: Build on Rust ${{ matrix.toolchain }}
         run: |
           cargo build --verbose --color always
+  test:
+    runs-on: ubuntu-latest
+    services:
+      postgres:
+        image: postgres
+        env:
+          POSTGRES_PASSWORD: postgres
+        options: >-
+          --health-cmd pg_isready
+          --health-interval 10s
+          --health-timeout 5s
+          --health-retries 5
+        ports:
+          - 5432:5432
+    steps:
+      - name: Checkout source code
+        uses: actions/checkout@v3
+      - name: Install Rust ${{ matrix.toolchain }} toolchain
+        uses: actions-rs/toolchain@v1
+        with:
+          toolchain: stable
+          override: true
+          profile: minimal
+      - name: Run tests
+        run: |
+          cargo test --verbose --color always -- --show-output
+        env:
+          RAPID_GOSSIP_TEST_DB_HOST: localhost
+          RAPID_GOSSIP_TEST_DB_NAME: postgres
+          RAPID_GOSSIP_TEST_DB_USER: postgres
+          RAPID_GOSSIP_TEST_DB_PASSWORD: postgres
+          RAPID_GOSSIP_SYNC_SERVER_LOG_LEVEL: gossip
index b62406d42240855c543df8719ca3f5f370b6ba9d..09147e920b501fd735ee7016c41a90da055b794b 100644 (file)
@@ -104,6 +104,7 @@ impl SchemaSanitizer {
        fn new() -> Self {
                IS_TEST_SCHEMA_CLEAN.with(|cleanliness_reference| {
                        let mut is_clean_option = cleanliness_reference.borrow_mut();
+                       assert!(is_clean_option.is_none());
                        *is_clean_option = Some(false);
                });