Skip to content

Commit

Permalink
Add a debug flag to validate schema reflection
Browse files Browse the repository at this point in the history
When the flag is set, after every DDL command we reintrospect the
database and compare that to the in-meory schema. I've recently landed
a few PRs fixing issues exposed by this. (IIRC, I also fixed a few
earlier this year when I first wrote this PR.) Overall the system is
pretty solid.

Run it in CI once a day, since I think it is too slow to run all the
time.

Fixes #5169.
  • Loading branch information
msullivan committed Nov 1, 2024
1 parent c845054 commit 8d724cc
Show file tree
Hide file tree
Showing 10 changed files with 691 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ all: workflows/nightly.yml \
workflows/tests-ha.yml \
workflows/tests-pg-versions.yml \
workflows/tests-patches.yml \
workflows/tests-inplace.yml
workflows/tests-inplace.yml \
workflows/tests-reflection.yml \

workflows/%.yml: workflows.src/%.tpl.yml workflows.src/%.targets.yml workflows.src/build.inc.yml workflows.src/ls-build.inc.yml
$(ROOT)/workflows.src/render.py $* $*.targets.yml
Expand All @@ -38,3 +39,6 @@ workflows.src/tests-patches.tpl.yml: workflows.src/tests.inc.yml

workflows.src/tests-inplace.tpl.yml: workflows.src/tests.inc.yml
touch $(ROOT)/workflows.src/tests-inplace.tpl.yml

workflows.src/tests-reflection.tpl.yml: workflows.src/tests.inc.yml
touch $(ROOT)/workflows.src/tests-inplace.tpl.yml
1 change: 1 addition & 0 deletions .github/workflows.src/tests-reflection.targets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
data:
59 changes: 59 additions & 0 deletions .github/workflows.src/tests-reflection.tpl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<% from "tests.inc.yml" import build, calc_cache_key, restore_cache -%>
name: Tests with reflection validation

on:
schedule:
- cron: "0 3 * * *"
workflow_dispatch:
inputs: {}
push:
branches:
- "REFL-*"

jobs:
build:
runs-on: ubuntu-latest

steps:
<%- call build() -%>

- name: Compute cache keys
env:
GIST_TOKEN: ${{ secrets.CI_BOT_GIST_TOKEN }}
run: |
<< calc_cache_key()|indent >>
<%- endcall %>

test:
needs: build
runs-on: ubuntu-latest

steps:
<<- restore_cache() >>

# Run the test

- name: Test
env:
EDGEDB_TEST_REPEATS: 1
run: |
edb test -j2 -v
workflow-notifications:
if: failure() && github.event_name != 'pull_request'
name: Notify in Slack on failures
needs:
- build
- test
runs-on: ubuntu-latest
permissions:
actions: 'read'
steps:
- name: Slack Workflow Notification
uses: Gamesight/slack-workflow-status@26a36836c887f260477432e4314ec3490a84f309
with:
repo_token: ${{secrets.GITHUB_TOKEN}}
slack_webhook_url: ${{secrets.ACTIONS_SLACK_WEBHOOK_URL}}
name: 'Workflow notifications'
icon_emoji: ':hammer:'
include_jobs: 'on-failure'
Loading

0 comments on commit 8d724cc

Please sign in to comment.