-
Notifications
You must be signed in to change notification settings - Fork 1
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
Automatic Running of Tests On Pull Request #1123
Merged
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
bc3ac6b
t1
2e26672
Update test-on-pr.yml
saifrk e9f4bdb
Fixes #1111
168eccc
Modifications1
348a207
Modifications2
5ee9087
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 74e5130
Mod3
b1192e5
Mod4
818158b
new
8416cc5
new
aa72027
Merge branch 'feature/add-github-actions' of https://github.com/NASA-…
07161d7
Merge branch 'dev' of https://github.com/NASA-IMPACT/COSMOS into feat…
97e7174
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] ce978c5
tst5
bc961ef
latest
bba9e0e
changes1
3d6ae59
changes2
3cdadf3
changes3
af8aa3d
changes4
fa7180c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] aec1172
changes5
5b6b1bd
Merge branch 'feature/add-github-actions' of https://github.com/NASA-…
0fd2f49
changes6
3897f3f
changes6.1
c258803
6.3
6d0f670
Resolved merge conflicts
342f7dc
6.4
30a4354
6.6
a17e468
6.7
5ae4b43
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 0ab6854
6.8
d4d8886
Merge branch 'feature/add-github-actions' of https://github.com/NASA-…
bbe8794
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 7db25dc
Update .github/workflows/run_full_test_suite.yml
CarsonDavis 2a92a48
remove extra github mock from test_workflow_status_triggers
CarsonDavis befc54a
Merge branch 'dev' into feature/add-github-actions
CarsonDavis 22bde3b
add back in saif's magic code
CarsonDavis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Django Test Suite on PR | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- dev | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
docker: | ||
image: docker:24.0.5 | ||
options: --privileged | ||
ports: | ||
- 5432:5432 | ||
|
||
steps: | ||
- name: Check out merged code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Compose | ||
run: | | ||
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | ||
sudo chmod +x /usr/local/bin/docker-compose | ||
|
||
- name: Build the Docker environment | ||
run: docker-compose -f local.yml build | ||
|
||
- name: Run test suite | ||
env: | ||
DJANGO_ENV: test | ||
run: docker-compose -f local.yml run --rm django bash ./init.sh | ||
|
||
- name: Cleanup | ||
run: docker-compose -f local.yml down --volumes |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
echo "Running all test cases across the project..." | ||
|
||
# Initialize a failure counter | ||
failure_count=0 | ||
|
||
# Exclude tests in `document_classifier` and `functional_tests` directories | ||
excluded_dirs="document_classifier functional_tests" | ||
|
||
# Find all test files except those in excluded directories | ||
test_files=$(find . -type f -name "test_*.py" | grep -Ev "$(echo $excluded_dirs | sed 's/ /|/g')") | ||
|
||
# Run each test file | ||
for test_file in $test_files; do | ||
echo "Running $test_file..." | ||
pytest "$test_file" | ||
|
||
# Check the exit status of pytest | ||
if [ $? -ne 0 ]; then | ||
echo "Test failed: $test_file" | ||
failure_count=$((failure_count + 1)) | ||
fi | ||
done | ||
|
||
# Report the results | ||
if [ $failure_count -ne 0 ]; then | ||
echo "$failure_count test(s) failed." | ||
exit 1 | ||
else | ||
echo "All tests passed successfully!" | ||
fi |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you take a look and see what this chunk of the code is actually doing so that I can understand it better? It doesn't seem like it interacts with the other test cases.