Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated quick-test script on github #91

Merged
merged 44 commits into from
Oct 23, 2024

Conversation

ruokun-niu
Copy link
Contributor

Description

  • Moved all smoke-test scripts and resources to be hosted on github instead of Azure storage blob
  • Used kubectl to setup a database instead of using helm
  • The smoke test will
    • Set up a postgres source, one continuous query and one result reaction
    • The query will retrieve all items that are in category A
    • Initially, there will be two items in the result set, one with ID 1 and one with ID3
    • Two entries will be added into the postgres database: one with ID 4 and category B, and one with ID 5 and category A
    • final result should have three items: ID 1, ID 3, and ID 5
  • The smoke test will be run in both bash and powershell to ensure compatibility with both environments

When this gets merged into main, the smoke-test can be invoked by using the following commands
MacOS:

curl -fsSL https://raw.githubusercontent.com/drasi-project/drasi-platform/main/dev-tools/smoke-tests/smoke-test.sh | /bin/bash -s <namespace>

Windows powershell

Invoke-Command -ScriptBlock ([scriptblock]::Create([System.Text.Encoding]::UTF8.GetString((New-Object Net.WebClient).DownloadData('https://raw.githubusercontent.com/drasi-project/drasi-platform/main/dev-tools/smoke-tests/smoke-test.ps1')))) -ArgumentList <namespace>

For now, if you want to test the script, run the following command (the file is hosted on a branch on my personal fork)

curl -fL https://raw.githubusercontent.com/ruokun-niu/drasi-platform/smoke-test-test/dev-tools/smoke-tests/smoke-test.sh | /bin/bash -s smoke

Logs from a successful bash run: https://gist.github.com/ruokun-niu/605eae11b9ec034285a2630f20521ea6
Logs from a successful powershell run: https://gist.github.com/ruokun-niu/724f1debfd276560356151a0295843a5

Type of change

  • This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Drasi (issue link optional).

Fixes: #issue_number

dev-tools/smoke-tests/setup-smoke-test.sh Fixed Show fixed Hide fixed
dev-tools/smoke-tests/setup-smoke-test.sh Fixed Show fixed Hide fixed
dev-tools/smoke-tests/smoke-test.ps1 Fixed Show fixed Hide fixed
dev-tools/smoke-tests/smoke-test.ps1 Fixed Show fixed Hide fixed
dev-tools/smoke-tests/smoke-test.sh Fixed Show fixed Hide fixed
dev-tools/smoke-tests/smoke-test.sh Fixed Show fixed Hide fixed
Copy link
Contributor

@agentofreality agentofreality left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any old smoke test files that need to be deleted from the repo?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, the source, query, and reaction should be deleted in reverse dependency order, although this is not going to matter right now, it will break when we do introduce dependency checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will reverse the order

@@ -0,0 +1,100 @@
echo Setting up Postgres...

helm repo add bitnami https://charts.bitnami.com/bitnami 1>/dev/null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the comment in the PR about moving from helm to kubectl to setup db?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, this file was supposed to be deleted but was accidentally checked-in. The actual smoke test should be the 'smoke-test.sh' file

@ruokun-niu
Copy link
Contributor Author

Are there any old smoke test files that need to be deleted from the repo?

Currently we dont have any old smoke test files in the Github repos. We can delete the ones that are stored in our storage blob once this PR gets merged

@agentofreality agentofreality self-requested a review October 23, 2024 14:01
Copy link
Contributor

@agentofreality agentofreality left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets:

  • put this in a folder called dev-tools/testing/quick-test-environment
  • change file names from 'smoke-test-' to 'quick-test-environment-'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice there is no cleanup for PowerShell

@ruokun-niu
Copy link
Contributor Author

Lets:

  • put this in a folder called dev-tools/testing/quick-test-environment
  • change file names from 'smoke-test-' to 'quick-test-environment-'

I'll also update any occurences of "Smoke Test" to "Quick Test" so that it is consistent with the samples in the doc site

@ruokun-niu ruokun-niu changed the title Updated smoke-test script on github Updated quick-test script on github Oct 23, 2024
@ruokun-niu ruokun-niu merged commit 0165216 into drasi-project:main Oct 23, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants